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

Method is_misparsed_function

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

isMisparsedFunction (dart.ts:177-188) — skip the UNNAMED constructor, and a `const` ctor / redirecting factory that names no enclosing type (error recovery's).

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

Source from the content-addressed store, hash-verified

604 /// and a `const` ctor / redirecting factory that names no enclosing type
605 /// (error recovery's).
606 fn is_misparsed_function(&self, node: Node<'t>) -> bool {
607 // The part of a Dart 3.13 primary constructor written in the class
608 // body, `this : y = x + 1 { … }`, belongs to the constructor the
609 // header declares: its body runs as the unnamed constructor's does.
610 let mut cursor = node.walk();
611 if node.named_children(&mut cursor).any(|c| c.kind() == "primary_constructor_body_signature") {
612 return true;
613 }
614 match self.ctor_info(node) {
615 Some((class_name, ctor_name)) => ctor_name == class_name,
616 None => is_bodiless_ctor(node.kind()),
617 }
618 }
619
620 /// getSignature (dart.ts:189-208).
621 fn signature_of(&self, node: Node<'t>) -> Option<String> {

Callers 2

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 3

is_bodiless_ctorFunction · 0.85
walkMethod · 0.80
ctor_infoMethod · 0.80

Tested by

no test coverage detected