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

Method resolve_body

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

resolveBody (dart.ts:158-171).

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

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected