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

Function preceding_go_doc_comment

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

getPrecedingDocstring's `skipTrailing`, `skipDetached` and `skipDirectives`, which Go turns on together for the doc comment go doc shows. The comments the run opens with that belong to the line above are left out: one written after code on its line (`const n = 4 // four.`), and any that begins on the line such a comment ends. Of the rest, only the comments that end on the line right above the decl

(node: Node, src: &str)

Source from the content-addressed store, hash-verified

159/// directive among them (`//go:embed static`, `//nolint:errcheck`) is left out
160/// of the text.
161pub fn preceding_go_doc_comment(node: Node, src: &str) -> Option<String> {
162 preceding_docstring_with(node, src, &[], true, true, true)
163}
164
165fn preceding_docstring_with(
166 node: Node,

Callers 1

docstring_ofMethod · 0.85

Calls 1

preceding_docstring_withFunction · 0.85

Tested by

no test coverage detected