Repository navigation
feat: rank file and folder suggestions by closest match - #485
Open
Christoffer Maintz (CMaintz) wants to merge 1 commit into
Open
Christoffer Maintz (CMaintz) wants to merge 1 commit into
Christoffer Maintz (CMaintz) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
Path suggestions sharing a priority showed up in filesystem order, so with fuzzy filtering `cd s` could list docs before src. Within a priority band, files and folders are now ranked by match quality (exact, prefix, substring), then shorter names, then alphabetically. Paths only swap places with other paths, so subcommands, options and spec suggestions keep their existing order.
Christoffer Maintz (CMaintz)
force-pushed
the
feat/relevance-sort
branch
from
October 9, 2026 11:54
0f744c4 to
4e95c9a
Compare
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.
Path suggestions that share a priority show up in filesystem order. With fuzzy filtering that gets noisy fast:
cd sin this repo listsdocsand.huskyahead ofsrc, and in my home dircd iputsIdeaProjects7th, past the default 5 visible.Within a priority band, files and folders are now ranked by:
Only paths are reordered, and only among themselves. Subcommands, options and spec-provided suggestions keep their current order, so things like
git stlook exactly like before. With nothing typed yet there's nothing to rank, so the order is left alone.cd snow givessrc, shell, scripts, docs, .husky, node_modules. I added that as a runtime test, andpathWithFileFilteredSuggestionchanges becauseshellIntegration.nunow beatsshellIntegration.bashon length.I first had this applied to every suggestion type, but that reshuffled subcommands and options in ways nobody asked for (and broke the
git ste2e snapshot), so I narrowed it to paths.