-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Search additional roots #10448
Search additional roots #10448
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.
@gbodeen speaking offline with @colin-grant-work, I believe in order for the pull-request to work well, we might need some variable resolution in settings.json
. I'm not sure that setting absolute paths will work well in the workspace
scope as this is usually checked-in to the repo, and will not work for other users.
packages/search-in-workspace/src/browser/search-in-workspace-preferences.ts
Outdated
Show resolved
Hide resolved
packages/search-in-workspace/src/browser/search-in-workspace-service.ts
Outdated
Show resolved
Hide resolved
612158c
to
c1f091d
Compare
OK, I'll take a look soon. |
c1f091d
to
585c869
Compare
@vince-fugnitto Variable resolution is added now. |
8a07c83
to
0242c73
Compare
Signed-off-by: Gabriel Bodeen <[email protected]>
0242c73
to
eb869ee
Compare
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 have tested the following, and it works as expected 👍
- Search of files (ctrl+p) within the folder of the
additionalRoots
- Search in workspace results include files withing the configured
additionalRoots
The code looks good to me as well,
Thanks !!
@gbodeen do you mind rebasing the pull-request, I can take a final look afterwards :) |
Downstream, we've decided on a different approach. Just like there's a little toggle button for searching in ignored files, we've added another button to toggle between searching the workspace roots and searching the git roots. It makes sense for our users, whose workspaces are subdirectories of very large repos. I'm not sure whether there's a variation on that which would be more generally useful and so suitable for Theia. |
@gbodeen sounds good! If you don't feel that the feature is useful in the base framework I think we can close the pr for the moment. |
Signed-off-by: Gabriel Bodeen [email protected]
What it does
This adds a preference for additional root directories to search in both the Search-In-Workspace widget and the File-Search (ctrl+p) menu.
In interviews with our users, one of their requests was for the search features to be able to find code that wasn't technically within their workspace, but that was located in other, closely-related directories. For particularly large directories, it can be advantageous to make the code easily searchable with Theia without incurring other costs such as file watching.
I wanted to check whether there was appetite for this preference to be added directly to the Theia project. This preference explicitly goes beyond what is currently available in VS Code.
How to test
additional
, switch to Workspace scope, and edit the JSON to enter one or more paths, e.g. to the Blueprint repo and to a non-existent directory. You can use variable substitutions. For example, in my settings.json I added"search.additionalRoots": ["${env:HOME}/test/", "/repo/${env:USER}/theia-blueprint"]
.Review checklist
** Note: I haven't tested on Windows or Mac.
Reminder for reviewers