vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Allow subsequence match for recently opened

Open tgeng opened this issue 7 months ago • 5 comments

This is a subtle usability issue. Consider a project containing two files foo_bar and bar_foo.

With "Go to file..." command, recently open files are preferred. This is all good. So if I type foo_b I get foo_bar suggested from recently opened, as expected.

Image

However, if I type foob, only results from "file results" are shown. The recently opened results are gone because foob doesn't match foo_bar. In other words, recently opened results only match substring, not sub sequence.

Image

For small projects this is fine. But for big projects with millions of files (monorepo in particular), file results are very slow and often shows me irrelevant results. So I it would be nice if recently opened section can also does subsequence matching.

It would be even greater if vscode can implement the smart subword matching like in intellij, where foob would match foo_bar, but fooa would not match foo_bar, because a didn't start the second word. (And this should also work for camel case).

tgeng avatar Apr 30 '25 17:04 tgeng

This is intentional. For history results, we pass in false for allowNonContiguousMatches:

https://github.com/microsoft/vscode/blob/02f077ed2914211a3038fb1dd134f879a2c15ea8/src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts#L522

Going back in time, it seems like ever since we added recently opened results... over 5 years ago, they've always had false for this.

@bpasero taking a walk down memory lane... do you recall anything about this decision? I am wondering why we would differentiate here.

TylerLeonhardt avatar May 07 '25 22:05 TylerLeonhardt

I cannot recall, we could change it and try it in insiders.

bpasero avatar May 08 '25 07:05 bpasero

Image

hmmm I don't like this. I would prefer the view.ts to be on top.

TylerLeonhardt avatar May 09 '25 21:05 TylerLeonhardt

Well, this change does not work without also tweaking how the sorting is. That is why the file picker is so complicated:

https://github.com/microsoft/vscode/blob/fc23b22bdb91560e230b2414b4e59826a997ef1f/src/vs/base/common/fuzzyScorer.ts#L56-L71

bpasero avatar May 10 '25 04:05 bpasero

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

:slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!