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

Function extract_docstring

internal/cbm/extract_defs.c:2809–2826  ·  view source on GitHub ↗

Doc of a Function/Method/Class-like definition. */

Source from the content-addressed store, hash-verified

2807
2808/* Doc of a Function/Method/Class-like definition. */
2809static const char *extract_docstring(CBMExtractCtx *ctx, TSNode node, const char *name) {
2810 CBMLanguage lang = ctx->language;
2811 if (lang == CBM_LANG_PERL) {
2812 const char *pod = pod_doc_by_name(ctx, name);
2813 if (pod) {
2814 return pod;
2815 }
2816 }
2817 if (lang == CBM_LANG_GO &&
2818 (doc_kind_is(node, "type_spec") || doc_kind_is(node, "type_alias"))) {
2819 return doc_go_type(ctx, node);
2820 }
2821 const char *doc = doc_for_anchor(ctx, doc_anchor(ctx, node));
2822 if (!doc && lang == CBM_LANG_PYTHON) {
2823 return extract_python_docstring(ctx->arena, node, ctx->source);
2824 }
2825 return doc;
2826}
2827
2828/* Doc of a Field, Variable, enum member or Macro (code languages only). */
2829static const char *extract_member_docstring_status(CBMExtractCtx *ctx, TSNode node,

Callers 6

extract_func_defFunction · 0.85
emit_class_defFunction · 0.85
extract_c_typedefFunction · 0.85
push_method_defFunction · 0.85
extract_rust_implFunction · 0.85

Calls 6

pod_doc_by_nameFunction · 0.85
doc_kind_isFunction · 0.85
doc_go_typeFunction · 0.85
doc_for_anchorFunction · 0.85
doc_anchorFunction · 0.85
extract_python_docstringFunction · 0.85

Tested by

no test coverage detected