fix(explore): accurately resolve query file paths and find camelCase symbols
Previously, `codegraph_explore` queries explicitly naming files by path (e.g., `src/routes/m/projects/[id]/runs/[runId]/+page.svelte`) were shredded. Bracketed path segments exploded into "named symbol" seeds, and FTS on fragments like `page` or `runs` admitted every sibling file, starving the user's intended target. This change introduces: - **Query path pinning:** File paths named in a query are now resolved against the index, "pinned," and stripped from the query. Pinned files are guaranteed inclusion, top ranking, and fair allocation. Unresolvable path-like spans are reported. - **Segment vocabulary supplement:** Natural language query terms (e.g., "auto-scroll to bottom") can now reach camelCase identifiers (e.g., `pinFeedIfNearBottom`, `feedAtBottom`) by matching against their constituent segments. - **Variable seeding:** `variable` and `constant` node kinds are now included in identifier seeding, improving recall for `$state`-style variables common in frameworks like Svelte.
This commit is contained in:
@@ -688,4 +688,13 @@ export interface FindRelevantContextOptions {
|
||||
|
||||
/** Node types to include */
|
||||
nodeKinds?: NodeKind[];
|
||||
|
||||
/**
|
||||
* Extra symbol names to merge in as exact-name search candidates, at a
|
||||
* dampened score. Fed by the segment-vocabulary supplement (CodeGraph.
|
||||
* findRelevantContext): word-level query terms can't reach camelCase names
|
||||
* through FTS — `pinFeedIfNearBottom` is one FTS token — so names whose
|
||||
* SEGMENTS the query's words name are seeded here instead.
|
||||
*/
|
||||
seedNames?: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user