microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.54k stars 28.65k forks source link

Terminal: recent command fuzzy search not very fuzzy #156325

Open isidorn opened 2 years ago

isidorn commented 2 years ago

Testing #156002

It seems like the terminal recent command fuzzy search wants to find fuzzy matches in different words only, if the matches are in the same word it ignores them. For example, have a bunch of git commands. Turn on fuzzy search. Search for "gt" - does not get matched against all git commands - which I would expect

Screenshot 2022-07-26 at 18 59 37

Screenshot 2022-07-26 at 18 59 50

meganrogge commented 2 years ago

That is odd, though we're using the fuzzy searching that's used elsewhere in VSCode, so I wonder if there's an issue tracking that.

meganrogge commented 2 years ago

@aeschli or @TylerLeonhardt I don't see one, but believe this is your domain

TylerLeonhardt commented 2 years ago

@Tyriar didn't you implement the fuzziness here?

meganrogge commented 2 years ago

Yes he did @TylerLeonhardt

meganrogge commented 2 years ago

I actually don't think @Tyriar had to do with this - we use matchesFuzzyIconAware which was added by @aeschli

Tyriar commented 2 years ago

This might be related to the quick pick's filtering, we should look into it first.

Fred-Vatin commented 1 year ago

I confirm it happens filtering commands in palette too.

Typing pwsh doesn’t find any powershell commands.

powers returns… image

pwsh returns nothing image

My setup

Version: 1.73.1 (user setup)
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T04:27:29.066Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: No
gpeal commented 1 year ago

I recently switched from the IntelliJ world to VSCode and the fuzzy match algorithm of VSCode is slowly driving me insane. In addition to the cases here, one thing that IntelliJ gets really right is case sensitive matching of partial words and priority for local symbols.

Check out this example. I am trying to match externalReport which is defined on the line immediately above. ext correctly matches. Typing R should increase the weight of the already-top result but instead, it drops off the list entirely.

The result of this is that I frequently wind up with random variables and imports as a result of the correct result disappearing after I type more letters that should only increase its weight.

CleanShot 2022-12-02 at 16 52 34@2x (1) CleanShot 2022-12-02 at 16 52 30@2x (1)

You can see a similar result play out here: CleanShot 2022-11-30 at 13 44 37@2x (1)

CleanShot 2022-11-30 at 13 45 20@2x (1)

This seems similar to https://github.com/microsoft/vscode/issues/34088 https://github.com/microsoft/vscode/issues/131431

Tyriar commented 1 year ago

@gpeal this issue is specifically about ranking in the run recent terminal command. https://github.com/microsoft/vscode/issues/34088 is probably what you want to comment on?

Tyriar commented 1 year ago

Assigning this to @TylerLeonhardt as it's essentially asking for proper fuzzy matching in the quick pick as in #34088

TylerLeonhardt commented 1 year ago

@Tyriar but I thought you disabled filtering and implemented your own fuzzy logic?

Tyriar commented 1 year ago

@tylerLeonhardt I think that's just for contiguous search, for fuzzy we defer to the default

TylerLeonhardt commented 1 year ago

ah so it's using fuzzy search...... it's just not fuzzy enough.