(node: SyntaxNode)
| 2961 | |
| 2962 | /** A constructor prototype carries defaults even when its body is in another file. */ |
| 2963 | export function isCppConstructorDeclaration(node: SyntaxNode): boolean { |
| 2964 | if (node.type !== 'declaration' || getChildByField(node, 'type')) return false; |
| 2965 | const owner = node.parent?.parent; |
| 2966 | if (!owner || !['class_specifier', 'struct_specifier', 'union_specifier'].includes(owner.type)) return false; |
| 2967 | const declarator = getChildByField(node, 'declarator'); |
| 2968 | return declarator?.type === 'function_declarator' |
| 2969 | && getChildByField(declarator, 'declarator')?.text === getChildByField(owner, 'name')?.text; |
| 2970 | } |
| 2971 | |
| 2972 | export const cppExtractor: LanguageExtractor = { |
| 2973 | // Recover macro-annotated class/struct definitions (`class MYMODULE_API Foo : Base`, |
no test coverage detected