* Does this query-named span point at a real FILE inside the project? * * The `existsOnDisk` predicate `extractQueryPaths` takes (that module is pure — * no DB, no fs — so the fs access lives here, where the project root is known). * Only a REGULAR FILE counts: a directory span (`src/search`) is
(projectRoot: string, relPath: string)
| 196 | * probe outside the project, and every fs error answers `false`. |
| 197 | */ |
| 198 | function pathIsProjectFile(projectRoot: string, relPath: string): boolean { |
| 199 | try { |
| 200 | const abs = validatePathWithinRoot(projectRoot, relPath); |
| 201 | return abs !== null && statSync(abs).isFile(); |
| 202 | } catch { |
| 203 | return false; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | /** Kinds that name a thing without defining it in the file that holds them. */ |
| 208 | const NOT_A_DEFINITION = new Set(['file', 'import', 'export', 'parameter']); |
no test coverage detected