Skip to content

perf(cache): make the file watcher respect scan filters; smarter defaults#79

Closed
dawsbot wants to merge 1 commit into
perf/74-bound-file-cachefrom
perf/harden-file-cache
Closed

perf(cache): make the file watcher respect scan filters; smarter defaults#79
dawsbot wants to merge 1 commit into
perf/74-bound-file-cachefrom
perf/harden-file-cache

Conversation

@dawsbot

@dawsbot dawsbot commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Stacked on #78 (the watcher fix builds on maxFilesCached / isTruncated from that branch). Merging #78 first will auto-retarget this to master.

Four fixes

1. The create-watcher no longer bypasses every bound. onDidCreate pushed every created file straight into _fileNames, checking neither ignore, includeGlob, nor maxFilesCached. An npm install flooded the cache with node_modules paths. Created files now go through the same filters as the findFiles scan, via a new pure src/glob-match.ts module (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 on null.

2. includeGlob changes now trigger a re-scan. Previously the config watcher only reacted to ignore, so editing includeGlob silently did nothing until a workspace switch or window reload.

3. Modernized relativePath.ignore defaults. Adds dist, build, coverage, .turbo, .cache, .venv, __pycache__ — common build/venv output that's large and almost never an import target.

4. searchCountLimit default 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).
  • tsc compiles cleanly. Watcher behavior not exercised in a live Extension Development Host.

🤖 Generated with Claude Code

…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>
@dawsbot dawsbot deleted the branch perf/74-bound-file-cache July 7, 2026 04:34
@dawsbot dawsbot closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant