(dir: string, onFile: (path: string) => void)
| 160 | } |
| 161 | |
| 162 | private async walk(dir: string, onFile: (path: string) => void): Promise<void> { |
| 163 | let entries: any[]; |
| 164 | try { |
| 165 | entries = await fs.readdir(dir, { withFileTypes: true }); |
| 166 | } catch { return; } |
| 167 | |
| 168 | for (const entry of entries) { |
| 169 | if (entry.name.startsWith('.') && entry.name !== '.env') { |
| 170 | // Allow .qodex through? no — it's in IGNORED_DIRS |
| 171 | continue; |
| 172 | } |
| 173 | if (entry.isDirectory()) { |
| 174 | if (IGNORED_DIRS.has(entry.name)) continue; |
| 175 | await this.walk(path.join(dir, entry.name), onFile); |
| 176 | } else if (entry.isFile()) { |
| 177 | // Only consider files we can actually extract symbols from. This keeps |
| 178 | // non-source files (e.g. a sibling codegraph.db / .db-wal / .db-shm, lock |
| 179 | // files, images) out of the scanned/skipped counts and off the removal scan. |
| 180 | const full = path.join(dir, entry.name); |
| 181 | if (detectLanguage(full)) onFile(full); |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | } |
no test coverage detected