* The `::` segments of a C++ class, struct or union name written with a * scope, the scope's template arguments dropped: `['SkipList', 'Node']` for * an out-of-line nested class `struct SkipList ::Node`. Such * a class was indexed ` `, so its members were no class's. *
(node: SyntaxNode, source: string)
| 366 | * (ccpp/mod.rs). |
| 367 | */ |
| 368 | function cppWrittenClassParts(node: SyntaxNode, source: string): string[] | undefined { |
| 369 | if (!CPP_CLASS_SPECIFIERS.has(node.type)) return undefined; |
| 370 | const written = getChildByField(node, 'name'); |
| 371 | if (written?.type !== 'qualified_identifier') return undefined; |
| 372 | let innermost: SyntaxNode | null = written; |
| 373 | while (innermost?.type === 'qualified_identifier') innermost = getChildByField(innermost, 'name'); |
| 374 | if (innermost?.type !== 'type_identifier') return undefined; |
| 375 | const parts = stripCppTemplateArgs(getNodeText(written, source)).split('::').map((p) => p.trim()).filter(Boolean); |
| 376 | return parts.length > 0 && parts.every((p) => /^[A-Za-z_]\w*$/.test(p)) ? parts : undefined; |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * The name a C++ `qualified_identifier` ends in, past its scopes: the |
no test coverage detected