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

Method resolve_body

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

resolveBody (dart.ts:158-171).

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

Source from the content-addressed store, hash-verified

741
742 /// resolveBody (dart.ts:158-171).
743 fn resolve_body(&self, node: Node<'t>) -> Option<Node<'t>> {
744 if matches!(node.kind(), "function_signature" | "method_signature") {
745 let next = node.next_named_sibling()?;
746 if next.kind() == "function_body" {
747 return Some(next);
748 }
749 return None;
750 }
751 if let Some(standard) = node.child_by_field_name("body") {
752 return Some(standard);
753 }
754 let mut cursor = node.walk();
755 let found = node
756 .named_children(&mut cursor)
757 .find(|c| matches!(c.kind(), "class_body" | "extension_body"));
758 found
759 }
760
761 /// extractName (tree-sitter.ts:90-192) — resolveName (ctor names) →
762 /// name field → the method_signature inner unwrap → identifier-ish

Callers 4

extract_functionMethod · 0.45
extract_methodMethod · 0.45
extract_classMethod · 0.45
extract_enumMethod · 0.45

Calls 1

walkMethod · 0.80

Tested by

no test coverage detected