fix: prefilter autocomplete on config.yaml to stop AST tracker errors#12596
Open
rodboev wants to merge 1 commit into
Open
fix: prefilter autocomplete on config.yaml to stop AST tracker errors#12596rodboev wants to merge 1 commit into
rodboev wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
35ba4ce to
5240d3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12562
Summary
Autocomplete runs on
config.yamlbecause the prefilter only checks forconfig.json. Since YAML lacks tree-sitter support, every autocomplete attempt on the config file logs "Document not found in AST tracker" errors. This addsconfig.yamlto the same guard that already blocksconfig.json.Root cause
core/autocomplete/prefiltering/index.ts:52compareshelper.filepathagainstgetConfigJsonPath()only. When Continue switched its default config format to YAML, this guard was never updated. The tree-sitter parser returnsundefinedfor.yamlfiles (the WASM is explicitly disabled incore/util/treeSitter.ts), so the AST tracker never has an entry for it.Changes
core/autocomplete/prefiltering/index.ts: derive the YAML config path fromgetConfigJsonPath().replace(/\.json$/, ".yaml")and add it to the filepath check on line 52, avoidinggetConfigYamlPath()which creates the file as a side effectcore/autocomplete/prefiltering/prefiltering.vitest.ts: new test verifying both config paths are prefilteredWhat this doesn't change
The autocomplete pipeline, AST tracker, tree-sitter language support, and the existing
config.jsonguard are all untouched. No new dependencies.Checklist
Screen recording or screenshot
N/A — no UI change.
Tests
cd core && npx vitest run autocomplete/prefiltering/prefiltering.vitest.ts— new test covering both config.json and config.yaml prefilter pathsSummary by cubic
Stop autocomplete from running on
config.yamlby extending the prefilter to treat it likeconfig.json. This prevents “Document not found in AST tracker” errors and adds a test covering both config paths.Written for commit 5240d3f. Summary will update on new commits.