(&self, node: Node<'t>)
| 1834 | } |
| 1835 | |
| 1836 | fn is_cpp_constructor_declaration(&self, node: Node<'t>) -> bool { |
| 1837 | if self.variant != Variant::Cpp || node.kind() != "declaration" || node.child_by_field_name("type").is_some() { |
| 1838 | return false; |
| 1839 | } |
| 1840 | let Some(owner) = node.parent().and_then(|p| p.parent()) else { return false }; |
| 1841 | if !matches!(owner.kind(), "class_specifier" | "struct_specifier" | "union_specifier") { return false; } |
| 1842 | let Some(decl) = node.child_by_field_name("declarator") else { return false }; |
| 1843 | decl.kind() == "function_declarator" && decl.child_by_field_name("declarator").map(|n| self.text(n)) |
| 1844 | == owner.child_by_field_name("name").map(|n| self.text(n)) |
| 1845 | } |
| 1846 | |
| 1847 | /// cppExtractor.getSignature (languages/c-cpp.ts): a C++ constructor |
| 1848 | /// definition or class-body prototype carries its parameter |
no test coverage detected