(caller: { filePath: string; language: Language })
| 145 | const texts = new Map<string, string | null>(); |
| 146 | let sites = 0; |
| 147 | const resolve = (caller: { filePath: string; language: Language }): { abs: string; language: Language } | null => { |
| 148 | const posix = caller.filePath.replace(/\\/g, '/'); |
| 149 | let file = files.get(posix); |
| 150 | if (file === undefined) { |
| 151 | file = null; |
| 152 | const found = findIndexedFile(cg, posix); |
| 153 | if (found && !hasDriftedOnDisk(projectRoot, found.storedPath, found.record)) { |
| 154 | try { |
| 155 | file = { abs: resolveProjectFile(projectRoot, found.storedPath), language: found.record.language as Language }; |
| 156 | } catch { |
| 157 | file = null; |
| 158 | } |
| 159 | } |
| 160 | files.set(posix, file); |
| 161 | } |
| 162 | return file; |
| 163 | }; |
| 164 | // Named rather than a method, because `createWhenReader` hands `when` out |
| 165 | // detached: it must not depend on `this`. |
| 166 | const guards = async ( |
no test coverage detected