(filePath: string)
| 8172 | // a changed file's indexed line numbers can point at other code (#1474). |
| 8173 | const read = new Map<string, { content: string; lines: string[] } | null>(); |
| 8174 | const readFile = (filePath: string) => { |
| 8175 | const held = read.get(filePath); |
| 8176 | if (held !== undefined) return held; |
| 8177 | let entry: { content: string; lines: string[] } | null = null; |
| 8178 | try { |
| 8179 | const abs = validatePathWithinRoot(projectRoot, filePath); |
| 8180 | if (abs && existsSync(abs)) { |
| 8181 | const content = readFileSync(abs, 'utf-8'); |
| 8182 | if (!this.isFileStaleOnDisk(cg, filePath, content)) entry = { content, lines: content.split(/\r?\n/) }; |
| 8183 | } |
| 8184 | } catch { |
| 8185 | entry = null; |
| 8186 | } |
| 8187 | read.set(filePath, entry); |
| 8188 | return entry; |
| 8189 | }; |
| 8190 | |
| 8191 | const isTest = this.testCodeReading(cg); |
| 8192 | const rel = (p: string) => p.replace(/\\/g, '/'); |
nothing calls this directly
no test coverage detected