(kinds: ReadonlySet<string>)
| 2562 | function classThroughAliases(simple: string, fromFile: string, context: ResolutionContext, seen: Set<string>): Node | null { |
| 2563 | const named = pascalNamed(simple, context); |
| 2564 | const visible = (kinds: ReadonlySet<string>): Node[] => { |
| 2565 | // In the unit's own files, then in the unit used last, which declares the |
| 2566 | // name Delphi sees; else in the one unit that does. |
| 2567 | const candidates = named.filter((n) => kinds.has(n.kind)); |
| 2568 | for (const file of ownUnitFiles(fromFile, context)) { |
| 2569 | const own = candidates.filter((n) => n.filePath === file); |
| 2570 | if (own.length > 0) return own; |
| 2571 | } |
| 2572 | const used = usedUnitFiles(fromFile, context); |
| 2573 | for (let i = used.length - 1; i >= 0; i--) { |
| 2574 | const there = candidates.filter((n) => n.filePath === used[i]); |
| 2575 | if (there.length > 0) return there; |
| 2576 | } |
| 2577 | return candidates.length > 0 && candidates.every((n) => n.filePath === candidates[0]!.filePath) ? candidates : []; |
| 2578 | }; |
| 2579 | const cls = declarationOf(visible(CLASS_KINDS)); |
| 2580 | if (cls) return cls; |
| 2581 | // A type alias names the class it stands for: `TVTAncestor = TVTAncestorVcl;`, |
no test coverage detected