-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
file search: include workspace folder in filter #89765
Conversation
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.
Sorry @urbas, I thought I had written a response to this already but I guess I didn't. This is a good start, thanks for the PR But the solution will need a little more than this because I think it should
- only search with the folder name when in a multiroot workspace
- and it should also search with custom configured folder names instead of the real folder name when it is set in the workspace.
This will require changing the QueryBuilder and the query object that it creates to search. Let me know if you aren't interested in doing that work and I could look into it this month.
@roblourens: both points sound very good. I'll do it. Regarding the implementation: yes, I'll change the query interfaces, but I will probably also have to change the I will try to avoid API breaking changes but this will be easier to do if I could test against some external code (i.e. extensions that implement the family of interfaces specified in the |
The extension search API is in vscode.proposed.d.ts, and that's not stabilized yet so it's not a big deal. I think you will need to add a |
@roblourens: I have started by introducing a concept of "named folders" and expanding the Unfortunately, I wasn't able to find a way to make the code simpler. However, I could make a slight modification to my approach. Instead of introducing I will also rebase on top of |
5ed11b5
to
22115c1
Compare
@roblourens: this is now ready for another round of reviews. The feature uses workspace folder names (not basenames) and it's disabled when there's only one folder in the workspace. The Windows build timed out but I'm not sure if my change caused that. Is that a flaky build or a real failure? |
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.
This looks great! We are stabilizing the Feb release this week. I will take another look next week when we start the March iteration.
"Go to File..." search can now filter files based on the workspace folder name. This feature is activated only when the workspace contains more than one folder. This is particularly useful when your workspace contains multiple files with the same name, each of them in another workspace folder. A common example is the `README.md` file. Say you want to find a `README.md` file from a particular folder, say `my-folder`. Before this change you'd have to press the `Down` button a few times before you could get to the file. With this change you'd instead search for `mfREADME.md`. The desired readme file should now appear closer to the top of the file search popup.
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.
Thanks!
It is now possible to filter files by the containing workspace folder in the "Go to File..." popup.
This is particularly useful when your workspace contains multiple projects, each with the same file.
A common example is the
README.md
file. Say you want to find aREADME.md
file from a particular folder, saymy-folder
. Before this change you'd have to press theDown
button a few times before you could get to the file.With this change you'd instead search for
mfREADME.md
. The desired readme file should now appear closer to the top of the file search popup.This PR fixes #32444