MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / preceding_docstring

Function preceding_docstring

codegraph-kernel/src/docstring.rs:135–137  ·  view source on GitHub ↗

getPrecedingDocstring — collect the comment run immediately preceding the node (climbing out of declaration wrappers first), cleaned and joined. Returns None when there is no preceding comment (a PRESENT-but-empty docstring after cleaning still returns Some(""), matching the TS helper).

(node: Node, src: &str)

Source from the content-addressed store, hash-verified

133/// Returns None when there is no preceding comment (a PRESENT-but-empty
134/// docstring after cleaning still returns Some(""), matching the TS helper).
135pub fn preceding_docstring(node: Node, src: &str) -> Option<String> {
136 preceding_docstring_stepping_over(node, src, &[])
137}
138
139/// getPrecedingDocstring's `stepOver` — sibling kinds that may stand between
140/// the declaration and its comments without ending the run (Dart's

Callers 15

extract_functionMethod · 0.85
extract_methodMethod · 0.85
extract_classMethod · 0.85
extract_interfaceMethod · 0.85
extract_enumMethod · 0.85
extract_type_aliasMethod · 0.85
extract_functionMethod · 0.85
extract_methodMethod · 0.85
extract_variableMethod · 0.85
extract_type_aliasMethod · 0.85
extract_classMethod · 0.85
extract_methodMethod · 0.85

Calls 1

Tested by

no test coverage detected