Make the @-file picker complete, deterministic and active-tab-first#209
Open
leonidasbarkas98-cpu wants to merge 1 commit into
Open
Conversation
The picker collected files with findFiles(..., 500) on every keystroke: the 500-results cap truncated the candidate set BEFORE filtering (files beyond it were unreachable, andrepimenta#58), findFiles returns results in unspecified order so each call produced a different 500-subset (non-deterministic lists, andrepimenta#24), and sorting by basename only left equal names in that unspecified order (andrepimenta#23). The active editor tab was not considered at all (andrepimenta#53). - collect once per picker opening into _workspaceFileCache (refreshed on every empty searchTerm, i.e. whenever the picker opens) with maxResults 10000 so the cap practically never bites; keystrokes now filter the cached snapshot instead of re-running findFiles, - excludes move to _buildExcludeGlob(): the previous nine defaults merged with the user's files.exclude/search.exclude entries (only values === true; patterns containing , { } are skipped so a single exotic pattern cannot corrupt the combined {a,b,...} glob), - relevance scoring (exact name 100 / prefix 90 / name substring 80 / path substring 60) replaces the plain includes filter; ties break on the relative path compared by codepoint (no localeCompare) — a total order, so identical input yields the identical list; slice(0, 50) now applies after ranking, - the active editor tab (file scheme only, matched via asRelativePath, case-insensitive on win32) is moved to the top of the ranked list; it is never force-added when outside the workspace or filtered out, - webview payload stays {name, path, fsPath} — no renderer change. 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.
The @-file picker collected files with
findFiles(..., 500)on every keystroke. The 500-results cap truncated the candidate set before filtering, so files beyond it were unreachable (#58); findFiles returns results in unspecified order, so each call produced a different 500-subset — non-deterministic lists (#24); sorting by basename only left equal names in that unspecified order (#23); and the active editor tab was not considered at all (#53).Changes:
files.exclude/search.excludeentries (patterns containing,{}are skipped so one exotic pattern cannot corrupt the combined glob).The webview payload shape is unchanged — no renderer change.
Addresses #58, #24, #23 and #53. Based on current main (ab6e307),
tsc --noEmitclean, no new dependencies.