MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / extract_docstring

Function extract_docstring

internal/cbm/extract_defs.c:1270–1288  ·  view source on GitHub ↗

Extract docstring from the node's leading comment.

Source from the content-addressed store, hash-verified

1268
1269// Extract docstring from the node's leading comment.
1270static const char *extract_docstring(CBMArena *a, TSNode node, const char *source,
1271 CBMLanguage lang) {
1272 if (lang == CBM_LANG_GO) {
1273 const char *doc = extract_go_type_docstring(a, node, source);
1274 if (doc) {
1275 return doc;
1276 }
1277 }
1278
1279 TSNode prev = ts_node_prev_sibling(node);
1280 if (!ts_node_is_null(prev) && is_comment_node(ts_node_type(prev))) {
1281 return extract_comment_text(a, prev, source);
1282 }
1283
1284 if (lang == CBM_LANG_PYTHON) {
1285 return extract_python_docstring(a, node, source);
1286 }
1287 return NULL;
1288}
1289
1290static TSNode find_jvm_modifiers(TSNode node, CBMLanguage lang);
1291

Callers 3

extract_func_defFunction · 0.85
extract_class_defFunction · 0.85
push_method_defFunction · 0.85

Calls 4

is_comment_nodeFunction · 0.85
extract_comment_textFunction · 0.85
extract_python_docstringFunction · 0.85

Tested by

no test coverage detected