-
Notifications
You must be signed in to change notification settings - Fork 29.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
Smarter workspaceContains handling? #34823
Comments
At the time this was implemented, that was the contract of the I don't know if that changed in the meantime. const query: ISearchQuery = {
folderQueries: this._workspace.folders.map(folder => ({ folder: folder.uri })),
type: QueryType.File,
maxResults: 1,
includePattern: includes
}; |
Ah ok, didn't know about |
It is implemented for text search with ripgrep, but looks to be not implemented for filesearch with |
@roblourens |
We can kill the process as soon as we get the right number of results, this is what text search does. |
We could optimize this case with an additional flag |
One way to verify with extension code is by using |
Would it be possible to avoid a full workspace scan from every
workspaceContains
that an extension declares by stopping a search once the first result is found? I know that this should work from the classic file traversal implementation but I am not sure aboutRipGrep
. Maybe there is a command to useRipGrep
in such a way that it would just return 0 or 1 when a result is found?Alternatively we could also do a heuristic: we could first do a quick check of the root level files of the workspace folders and only run the more expensive file search if no files match. I would argue that in most cases the file of interest would actually be in the root folder (e.g.
tsconfig.json
).The text was updated successfully, but these errors were encountered: