(&self, node: Node<'t>)
| 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 |
no test coverage detected