* Which indexed files define a symbol spelled like this query token? * * The `symbolFiles` lookup `extractQueryPaths` takes, split out for the same * reason as `pathIsProjectFile`: that module stays DB-free. Exact names only — * and the shared matcher for a qualified token (`SQLCompiler.as_sql`)
(cg: CodeGraph, symbol: string)
| 252 | * answer "none", which leaves the span's pins as they were. |
| 253 | */ |
| 254 | function filesDefiningSymbol(cg: CodeGraph, symbol: string): string[] { |
| 255 | try { |
| 256 | const goPackageOf = goPackageReaderFor(cg); |
| 257 | const nodes = isQualifiedSymbol(symbol) |
| 258 | ? cg.getNodesByName(lastQualifierPart(symbol)).filter((n) => matchesSymbol(n, symbol, goPackageOf)) |
| 259 | : cg.getNodesByName(symbol); |
| 260 | return nodes.filter((n) => !NOT_A_DEFINITION.has(n.kind)).map((n) => n.filePath); |
| 261 | } catch { |
| 262 | return []; |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * Calculate the recommended number of codegraph_explore calls based on project size. |
no test coverage detected