fix(server): list dotfiles when the workspace root fills the entry cap#38
Merged
Conversation
The file explorer's dotfile supplement walk was gated on the combined entry count (native finder results + discovered dotfiles) staying under WORKSPACE_INDEX_MAX_ENTRIES. When the root is a large tree such as the home directory, the native (gitignore-filtered) scan alone reaches the 25k cap, so the supplement loop never ran and no dotfiles were listed. - supplementDotfiles now tracks only its newly discovered entries against its own budget; the finder results are used solely for dedup and to seed the directories to scan, not counted against the cap. - list() inserts the discovered dotfiles first, then fills the remaining budget with native entries, so a large native tree can no longer starve dotfile discovery. Adds a regression test that fills the native results to the cap and asserts a real dotfile still surfaces. Fixes #37 Co-Authored-By: Claude Opus 4.8 <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.
Problem
Fixes #37 — no dotfiles are listed in the file explorer when the root is set to
~/.552e133d3added dotfile support via a filesystem walk (supplementDotfiles) that supplements the native finder's results (the native finder honors gitignore and hides dotfiles). That walk was gated on the combined entry count staying under the 25k cap:entryByPathwas seeded with the native finder's results. For a large tree like the home directory (30k+ files on a typical dev machine, over theWORKSPACE_INDEX_MAX_ENTRIES = 25_000cap), the native scan alone fillsentryByPathto the cap, so the supplement loop body never runs and zero dotfiles get added. Normal project roots stay under the cap, which is why the bug only showed up in~/.Fix
supplementDotfilesnow tracks only its newly discovered dotfile entries against its own budget. The finder results are used solely for dedup and to seed which directories to scan — they no longer count against the cap.listinserts the discovered dotfiles first, then fills the remaining budget with native entries, so a large native tree can no longer starve dotfile discovery.Testing
tsgotypecheck and lint clean.🤖 Generated with Claude Code