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

Method is_cpp_constructor_declaration

codegraph-kernel/src/ccpp/mod.rs:1845–1854  ·  view source on GitHub ↗
(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1843 }
1844
1845 fn is_cpp_constructor_declaration(&self, node: Node<'t>) -> bool {
1846 if self.variant != Variant::Cpp || node.kind() != "declaration" || node.child_by_field_name("type").is_some() {
1847 return false;
1848 }
1849 let Some(owner) = node.parent().and_then(|p| p.parent()) else { return false };
1850 if !matches!(owner.kind(), "class_specifier" | "struct_specifier" | "union_specifier") { return false; }
1851 let Some(decl) = node.child_by_field_name("declarator") else { return false };
1852 decl.kind() == "function_declarator" && decl.child_by_field_name("declarator").map(|n| self.text(n))
1853 == owner.child_by_field_name("name").map(|n| self.text(n))
1854 }
1855
1856 /// cppExtractor.getSignature (languages/c-cpp.ts): a C++ constructor
1857 /// definition or class-body prototype carries its parameter

Callers 2

dispatch_nodeMethod · 0.80
constructor_signatureMethod · 0.80

Calls 2

mapMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected