MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / getPythonDocstring

Function getPythonDocstring

website/src/lib/parser.worker.ts:547–559  ·  view source on GitHub ↗
(node: any)

Source from the content-addressed store, hash-verified

545}
546
547function getPythonDocstring(node: any): string | null {
548 // Python docstring is the first expression statement if it's a string
549 const body = node.childForFieldName('body');
550 if (!body || body.childCount === 0) return null;
551 const first = body.child(0);
552 if (first?.type === 'expression_statement') {
553 const strNode = first.child(0);
554 if (strNode?.type === 'string') {
555 return strNode.text.replace(/['"]+/g, '').trim();
556 }
557 }
558 return null;
559}
560
561function valForLabel(label: string): number {
562 switch (label) {

Callers 1

processNextBatchFunction · 0.85

Calls 2

childForFieldNameMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected