Skip to content

fix: prefilter autocomplete on config.yaml to stop AST tracker errors#12596

Open
rodboev wants to merge 1 commit into
continuedev:mainfrom
rodboev:pr/prefilter-config-yaml
Open

fix: prefilter autocomplete on config.yaml to stop AST tracker errors#12596
rodboev wants to merge 1 commit into
continuedev:mainfrom
rodboev:pr/prefilter-config-yaml

Conversation

@rodboev

@rodboev rodboev commented Jun 10, 2026

Copy link
Copy Markdown

Fixes #12562

Summary

Autocomplete runs on config.yaml because the prefilter only checks for config.json. Since YAML lacks tree-sitter support, every autocomplete attempt on the config file logs "Document not found in AST tracker" errors. This adds config.yaml to the same guard that already blocks config.json.

Root cause

core/autocomplete/prefiltering/index.ts:52 compares helper.filepath against getConfigJsonPath() only. When Continue switched its default config format to YAML, this guard was never updated. The tree-sitter parser returns undefined for .yaml files (the WASM is explicitly disabled in core/util/treeSitter.ts), so the AST tracker never has an entry for it.

Changes

  • core/autocomplete/prefiltering/index.ts: derive the YAML config path from getConfigJsonPath().replace(/\.json$/, ".yaml") and add it to the filepath check on line 52, avoiding getConfigYamlPath() which creates the file as a side effect
  • core/autocomplete/prefiltering/prefiltering.vitest.ts: new test verifying both config paths are prefiltered

What this doesn't change

The autocomplete pipeline, AST tracker, tree-sitter language support, and the existing config.json guard are all untouched. No new dependencies.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

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 paths

Summary by cubic

Stop autocomplete from running on config.yaml by extending the prefilter to treat it like config.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.

Review in cubic

@rodboev rodboev requested a review from a team as a code owner June 10, 2026 23:47
@rodboev rodboev requested review from sestinj and removed request for a team June 10, 2026 23:47
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread core/autocomplete/prefiltering/prefiltering.vitest.ts Outdated
@rodboev rodboev force-pushed the pr/prefilter-config-yaml branch from 35ba4ce to 5240d3f Compare June 10, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

AST Tracker cannot find config.yaml

1 participant