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

Method resolve_body

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

resolveBody (dart.ts:158-171).

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

Source from the content-addressed store, hash-verified

664
665 /// resolveBody (dart.ts:158-171).
666 fn resolve_body(&self, node: Node<'t>) -> Option<Node<'t>> {
667 if matches!(node.kind(), "function_signature" | "method_signature") {
668 let next = node.next_named_sibling()?;
669 if next.kind() == "function_body" {
670 return Some(next);
671 }
672 return None;
673 }
674 if let Some(standard) = node.child_by_field_name("body") {
675 return Some(standard);
676 }
677 let mut cursor = node.walk();
678 let found = node
679 .named_children(&mut cursor)
680 .find(|c| matches!(c.kind(), "class_body" | "extension_body"));
681 found
682 }
683
684 /// extractName (tree-sitter.ts:90-192) — resolveName (ctor names) →
685 /// 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