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

Method declaration_wrapper

codegraph-kernel/src/dart.rs:643–653  ·  view source on GitHub ↗

getDeclarationWrapper (dart.ts) — a member with no body (`Foo._();`, `const Foo.c();`, an abstract `void m();`) is a `declaration` wrapping its signature, and the member's `///` dartdoc and `@annotation`s come before the wrapper. A signature that opens the declaration takes both from there.

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

641 /// before the wrapper. A signature that opens the declaration takes both
642 /// from there.
643 fn declaration_wrapper(&self, node: Node<'t>) -> Option<Node<'t>> {
644 let parent = node.parent()?;
645 if parent.kind() != "declaration" {
646 return None;
647 }
648 if parent.named_child(0)? == node {
649 Some(parent)
650 } else {
651 None
652 }
653 }
654
655 /// docstringFor (tree-sitter.ts) — the preceding comment run, looked up
656 /// from the declaration wrapper when there is one, past annotations.

Callers 2

docstring_ofMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected