-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuzzy search for @-ing files and symbols #1889
Conversation
vscode/package.json
Outdated
@@ -1181,6 +1181,7 @@ | |||
"classnames": "^2.3.2", | |||
"date-fns": "^2.30.0", | |||
"detect-indent": "^7.0.1", | |||
"fuzzysort": "^2.0.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a few but this was the fastest and smallest
As macOS e2e tests are hanging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on supporting fuzzy search! It doesn't fixes the issue mentioned in #1837 as I mentioned in #1851 that the only one to get perfectly consistent results is to remove the limit for MAX_RESULTS
which is currently set to 20 in your branch. You can see the last item is sometimes different when doing the same search when testing from your branch:
Screen.Recording.2023-11-27.at.10.54.28.AM.mov
Other than that, I think we should group the editorTab into ContextFileType and this should be good to go? Wdyt?
{contextSelection?.length ? ( | ||
<div className={classNames(styles.selectionsContainer)}> | ||
{contextSelection?.map((match, i) => { | ||
const icon = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it intended to not display icon for file results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, unless we can do extension-specific file icons (there's no support for that in webviews is there?) there's no need, especially now that files aren't intermingled with symbols.
That's unexpected… it should return every file in the workspace because of I'll check what’s going on here… 🤔 |
@toolmantim I found a solution that works and created a separate PR to merge it into this PR (to avoid making direct changes to your PR in case it doesn't work for you): #1917 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed:
- Results are consistently sorted
- Support fuzzy search
- Search is not case-sensitive
- Search support extension search
Screen.Recording.2023-11-27.at.7.12.29.PM.mov
I noticed the search results are not sorted alphabetically. If this is the intended behavior then I think it's good to go. Thanks for working on this!
Thanks @abeatrix! Yep that's intended… the fuzzy sorting is smarter than alphabetical, it's only if two items are scored the same we fall back to alphabetical. |
This updates the @-file UI with cleaned up styles, fuzzy matching, and putting symbol search behind it's own
@#
syntax.Fixes #1838
Fixes #1837
Fixes #1840
Replaces #1851
Changes:
@
@#
Not included:
@some-file.ts#SymbolName
)Test plan