* Does `ref.referenceName` match an import declared in its containing * file? Used as a pre-filter escape so re-export chain resolution * still gets a chance when the name has no project-wide declaration.
(ref: UnresolvedRef)
| 836 | * still gets a chance when the name has no project-wide declaration. |
| 837 | */ |
| 838 | private matchesAnyImport(ref: UnresolvedRef): boolean { |
| 839 | const imports = this.context.getImportMappings(ref.filePath, ref.language); |
| 840 | if (imports.length === 0) return false; |
| 841 | for (const imp of imports) { |
| 842 | if ( |
| 843 | imp.localName === ref.referenceName || |
| 844 | ref.referenceName.startsWith(imp.localName + '.') |
| 845 | ) { |
| 846 | return true; |
| 847 | } |
| 848 | } |
| 849 | return false; |
| 850 | } |
| 851 | |
| 852 | /** |
| 853 | * Resolve a single reference |
no test coverage detected