* The class (or record) an implementation header names (`TOuter::TInner`, * generic parameters dropped): the one `filePath` declares, whatever its case * or parameters, else one the file sees.
(qualifiedName: string, filePath: string, context: ResolutionContext)
| 696 | * or parameters, else one the file sees. |
| 697 | */ |
| 698 | function classByQualifiedName(qualifiedName: string, filePath: string, context: ResolutionContext): Node | null { |
| 699 | const memo = memos(context).classByQn; |
| 700 | const key = `${filePath}|${qualifiedName}`; |
| 701 | if (memo.has(key)) return memo.get(key)!; |
| 702 | const exact = context.getNodesByQualifiedName(qualifiedName).filter((n) => n.language === 'pascal' && CLASS_KINDS.has(n.kind)); |
| 703 | const lower = qualifiedName.toLowerCase(); |
| 704 | let cls: Node | null = null; |
| 705 | for (const file of ownUnitFiles(filePath, context)) { |
| 706 | cls = declarationOf(exact.filter((n) => n.filePath === file)) ?? |
| 707 | declarationOf(outlineOf(file, context).classes.filter((n) => n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase() === lower)); |
| 708 | if (cls) break; |
| 709 | } |
| 710 | cls ??= declarationOf(exact) ?? classNamed(qualifiedName.split('::').pop()!, filePath, context); |
| 711 | memo.set(key, cls); |
| 712 | return cls; |
| 713 | } |
| 714 | |
| 715 | /** |
| 716 | * The class declaration among same-named nodes, not a forward declaration |
no test coverage detected