(filePath: string)
| 8150 | // a changed file's indexed line numbers can point at other code (#1474). |
| 8151 | const read = new Map<string, { content: string; lines: string[] } | null>(); |
| 8152 | const readFile = (filePath: string) => { |
| 8153 | const held = read.get(filePath); |
| 8154 | if (held !== undefined) return held; |
| 8155 | let entry: { content: string; lines: string[] } | null = null; |
| 8156 | try { |
| 8157 | const abs = validatePathWithinRoot(projectRoot, filePath); |
| 8158 | if (abs && existsSync(abs)) { |
| 8159 | const content = readFileSync(abs, 'utf-8'); |
| 8160 | if (!this.isFileStaleOnDisk(cg, filePath, content)) entry = { content, lines: content.split(/\r?\n/) }; |
| 8161 | } |
| 8162 | } catch { |
| 8163 | entry = null; |
| 8164 | } |
| 8165 | read.set(filePath, entry); |
| 8166 | return entry; |
| 8167 | }; |
| 8168 | |
| 8169 | const isTest = this.testCodeReading(cg); |
| 8170 | const rel = (p: string) => p.replace(/\\/g, '/'); |
nothing calls this directly
no test coverage detected