-
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
support file searches with globs #4406
Conversation
This is in the findFiles(include: GlobPattern, exclude?: GlobPattern | null, maxResults?: number, token?: CancellationToken): Thenable<Uri[]> where an example of With the current theia code, if "**/*work*" is passed to |
5692e70
to
c0ac8e2
Compare
@kittaakos Thank you for the review !
I tested on both gitpod and my local env, and looks like it worked properly when i key-in |
Crazy. Thanks for checking! Something is odd either in my Chrome or with GItpod. I had an odd behavior when I was reviewing #4392 too. Can someone else verify this PR? |
it would be a nice feature to add, but I am not sure how to implement it. can i create a github issue so that i can resolve it separately, after this one gets merged ? |
Sure. |
@lmcbout I made the change that you and Marc suggested. Now the users don't have to key-in the trailing star (*). |
- vscode.workspace.findFiles() requires the search service to support finding files with globs, while the theia service only supports string match at the moment. Since the Theia goal is making the plugin system compatible with vscode extensions, the glob support should be added to theia file search service. Signed-off-by: elaihau <liang.huang@ericsson.com>
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.
LGTM overall, although there is something that I don't really understand, which is that in VS Code, the *
character seems to be ignored in the file-quick-open widget.
Still in VS Code, say there is a file like ...vscode/src/vs/platform/list/browser/listService.ts
I can type the following in order to access it, and it seems to make no difference:
platform//browser
platform/*/browser
platform/**/browser
pl*atform/***************/brow*****ser***
Back to Theia, IIUC this change was originally to fix the API for plugins, but why does it have an impact on the file search from the quick open menu?
You are right. vscode api supports globs, while its frontend ignores the stars (*).
theia front end sends whatever the user enters to the backend, and therefore you can use the frontend to test functional changes i made to the backend. regarding the impact on the file search experience, we had a small group discussion in the office with Jacques, Marc, & Jean. here is what I personally think: the user can still do whatever they used to do to search the files. The string match and fuzzy match are still performed. what this change offers the user is using globs, which helps the more advanced users to more precisely locate the files they need. entering stars (*) into the vscode file search is equivalent to using spaces, e.g., the case that vscode supports and theia-this-patch does not, is searching with spaces, e.g., searching with @marechal-p |
related to #4216 |
Signed-off-by: elaihau liang.huang@ericsson.com