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

RO
5mo ago
+55-2

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.