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

Method resolve_body

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

resolveBody (dart.ts:158-171).

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

Source from the content-addressed store, hash-verified

537
538 /// resolveBody (dart.ts:158-171).
539 fn resolve_body(&self, node: Node<'t>) -> Option<Node<'t>> {
540 if matches!(node.kind(), "function_signature" | "method_signature") {
541 let next = node.next_named_sibling()?;
542 if next.kind() == "function_body" {
543 return Some(next);
544 }
545 return None;
546 }
547 if let Some(standard) = node.child_by_field_name("body") {
548 return Some(standard);
549 }
550 let mut cursor = node.walk();
551 let found = node
552 .named_children(&mut cursor)
553 .find(|c| matches!(c.kind(), "class_body" | "extension_body"));
554 found
555 }
556
557 /// extractName (tree-sitter.ts:90-192) — resolveName (ctor names) →
558 /// 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

no outgoing calls

Tested by

no test coverage detected