* The node of the class a lookup found, among the declarations the lookup can * see (`visible`; null: the name names no particular class; undefined: keep * looking).
(named: CppNamedType, site: CppNameSite, context: ResolutionContext, visible: (n: Node) => boolean)
| 374 | * looking). |
| 375 | */ |
| 376 | function classNode(named: CppNamedType, site: CppNameSite, context: ResolutionContext, visible: (n: Node) => boolean): Node | null | undefined { |
| 377 | if (named === null || named === undefined) return named; |
| 378 | if (site.declared) return declarationNode(named, site, context, visible); |
| 379 | if ('alias' in named) return named.alias; |
| 380 | if ('enums' in named) return null; |
| 381 | const classes = context |
| 382 | .getNodesByQualifiedName(named.cls) |
| 383 | .filter((n) => isCFamily(n) && CLASS_KINDS.has(n.kind) && n.id !== site.self?.id); |
| 384 | // A lookup that ended on the class itself (its namespace lost) found nothing. |
| 385 | if (classes.length === 0) return undefined; |
| 386 | const shown = classes.filter(visible); |
| 387 | return pick(shown.length > 0 ? shown : classes, site.file); |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * The declaration a type name found by a lookup stands for, among all that one |
no test coverage detected