(caller: { filePath: string; language: Language })
| 152 | const texts = new Map<string, string | null>(); |
| 153 | let sites = 0; |
| 154 | const resolve = (caller: { filePath: string; language: Language }): { abs: string; language: Language } | null => { |
| 155 | const posix = caller.filePath.replace(/\\/g, '/'); |
| 156 | let file = files.get(posix); |
| 157 | if (file === undefined) { |
| 158 | file = null; |
| 159 | const found = findIndexedFile(cg, posix); |
| 160 | if (found && !hasDriftedOnDisk(projectRoot, found.storedPath, found.record)) { |
| 161 | try { |
| 162 | file = { abs: resolveProjectFile(projectRoot, found.storedPath), language: found.record.language as Language }; |
| 163 | } catch { |
| 164 | file = null; |
| 165 | } |
| 166 | } |
| 167 | files.set(posix, file); |
| 168 | } |
| 169 | return file; |
| 170 | }; |
| 171 | /** A file's text, once, for the directive and declaration reads; null past the size cap or unreadable. */ |
| 172 | const readText = (abs: string): string | null => { |
| 173 | let text = texts.get(abs); |
no test coverage detected