(filePath: string)
| 8458 | // a changed file's indexed line numbers can point at other code (#1474). |
| 8459 | const read = new Map<string, { content: string; lines: string[] } | null>(); |
| 8460 | const readFile = (filePath: string) => { |
| 8461 | const held = read.get(filePath); |
| 8462 | if (held !== undefined) return held; |
| 8463 | let entry: { content: string; lines: string[] } | null = null; |
| 8464 | try { |
| 8465 | const abs = validatePathWithinRoot(projectRoot, filePath); |
| 8466 | if (abs && existsSync(abs)) { |
| 8467 | const content = readFileSync(abs, 'utf-8'); |
| 8468 | if (!this.isFileStaleOnDisk(cg, filePath, content)) entry = { content, lines: content.split(/\r?\n/) }; |
| 8469 | } |
| 8470 | } catch { |
| 8471 | entry = null; |
| 8472 | } |
| 8473 | read.set(filePath, entry); |
| 8474 | return entry; |
| 8475 | }; |
| 8476 | |
| 8477 | const isTest = this.testCodeReading(cg); |
| 8478 | const rel = (p: string) => p.replace(/\\/g, '/'); |
nothing calls this directly
no test coverage detected