perf(cache): make the file watcher respect scan filters; smarter defaults#79
Closed
dawsbot wants to merge 1 commit into
Closed
perf(cache): make the file watcher respect scan filters; smarter defaults#79dawsbot wants to merge 1 commit into
dawsbot wants to merge 1 commit into
Conversation
…ults Four hardening fixes to the file-cache settings: - onDidCreate pushed every created file into the cache unfiltered, so a bulk creation like npm install flooded _fileNames with node_modules paths, bypassing ignore, includeGlob, and maxFilesCached. Created files now pass through the same filters as the findFiles scan (new pure glob-match module, unit-tested), respect the cap, and are skipped when outside the active workspace folder. Both watcher handlers also no longer throw if they fire before the first scan finishes. - Changing relativePath.includeGlob now triggers a re-scan; previously it silently did nothing until a workspace switch or reload. - relativePath.ignore default gains modern build-output dirs: dist, build, coverage, .turbo, .cache, .venv, __pycache__. - relativePath.searchCountLimit default raised 1000 -> 10000; modern quick pick handles that comfortably, so most projects get the one-step filter picker. Stale "performance issues" wording dropped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Stacked on #78 (the watcher fix builds on
maxFilesCached/isTruncatedfrom that branch). Merging #78 first will auto-retarget this tomaster.Four fixes
1. The create-watcher no longer bypasses every bound.
onDidCreatepushed every created file straight into_fileNames, checking neitherignore,includeGlob, normaxFilesCached. Annpm installflooded the cache with node_modules paths. Created files now go through the same filters as thefindFilesscan, via a new puresrc/glob-match.tsmodule (supports**,*,?,{a,b}— the subset VS Code documents for these settings). Creations also respect the cap (marking the list truncated instead of growing past it) and are skipped when outside the active workspace folder. Both watcher handlers are guarded against firing before the first scan finishes, which previously threw onnull.2.
includeGlobchanges now trigger a re-scan. Previously the config watcher only reacted toignore, so editingincludeGlobsilently did nothing until a workspace switch or window reload.3. Modernized
relativePath.ignoredefaults. Addsdist,build,coverage,.turbo,.cache,.venv,__pycache__— common build/venv output that's large and almost never an import target.4.
searchCountLimitdefault raised 1000 → 10000. The setting only gates which UI opens (one-step filter picker vs. two-step search box); VS Code's quick pick handles 10k items comfortably, so most projects now get the one-step flow. Dropped the stale "may lead to performance issues" wording.Testing
npm test: 23/23 pass (8 new tests covering**/*/?/brace semantics, regex escaping, and the add-to-cache decision against default ignore globs).tsccompiles cleanly. Watcher behavior not exercised in a live Extension Development Host.🤖 Generated with Claude Code