-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
workspaceContains starts a search over full workspace, including .git/, node_modules/ #34711
Comments
I suggest we do the following: Analyse how many extensions in the marketplace use workspaceContains glob patterns and take a look if anyone of them would be negatively impacted if we would include the search excludes in there. @sandy081 is looking into some tooling for such use cases. |
@sandy081 can vscode-tools help us analyze this yet? It would really help if a workspaceContains search would skip We also have #33528 to look at this for findFiles |
@roblourens Yes. It supports querying on activationEvent by passing a regEx value. For example
will give you extensions activating on workspace containing |
Thanks! I only see one that depends on |
Is this considered for November 2017? This would be important for me. |
I wonder if there is a general way to limit the amount of resources One option might be to stop the search after some time (e.g., 10s) and treat it as no match (to avoid grabbing more resources). |
@chrmarti I like your suggestion. I would also add, perhaps there is a depth setting we could use, i.e. search 4 folder levels in, and not deeper, etc. |
There is a max depth parameter for Ripgrep. The downside of that would be that it would break scenarios with few files in a deep folder structure. In other cases it might not change much, because already 4 levels can be too many files. Maybe using We then need to document that |
Yes this is exactly what I want. If you are using the C# extension, and for some reason we can't find a single csproj or .cs file in 10 seconds, then you'll probably open a csharp file at some point (activating the extension by onLanguage) or run a csharp command. If none of this, you probably won't benefit from the extension. We could also check opened files against the workspaceContains patterns, I don't think we do that currently. |
@chrmarti Maybe opposite of that, I mean let we have |
@Thaina |
If you can't limit the scope of the search cache or persist it to disk, please add a setting to disable the cache entirely. #34487 is not an “improvement” in a repo with half a million files after |
I think with #57046 we'll get that telemetry anyway |
Just to add to the overall picture: @reggiew2, the reporter of #55649, saw the issue when opening the home folder and the reported hardware looks similar to mine, so I ran the following measurements with (the default) and without following symlinks on my home folder (hoping that would have a somewhat similar structure to the reported one):
Not following symlinks ( |
I forgot: Ripgrep's default is to use
|
Yeah we can use the configured values of those settings to follow what someone said above, if normal search can find it, workspaceContains will find it. |
I think we should put this in the first week of September so it has plenty of time in Insiders, unless anyone has any objection. |
#34711 - run search for 5s, if it times out, activate the extension anyway
Fixed in #57047 Should use the user's excludes, and configured "use ignore files" and "follow symlinks" settings, and searches are limited to 5s, after which the extension is activated anyway. The possible downside is that you activate extensions which actually shouldn't be activated. Hopefully this will be ok. |
Capture workspaceContainsTimeout numbers
I've noticed extensions being activated from timeout when my macbook is doing a lot. If I set I added telemetry so we can see how much this happens in the wild |
Besides what we can see in telemetry, I want to get an idea of when this will happen. I published an extension that does nothing but show a notification when it's activated, and is activated on a workspaceContains pattern that doesn't exist. If anyone wants to help out, you can install this extension https://marketplace.visualstudio.com/items?itemName=roblourens.vscode-workspacecontains-canary and take note when you see the notification. If you open a very large workspace, or many windows all at once, or something like that, then you will see the notification and that is expected and by design. But if you see it when it's not expected, then you can take note of what else your computer was doing at the time that might have slowed search down. Then let me know if you see it happening at random times, and if so, we may want to raise the limit by a couple seconds, or tweak it somehow. For example, I was thinking that instead of measuring 5s in extensionHostMain where we look at the workspaceContains pattern, we might want to include a timeout as a search option and measure closer to where the search is actually performed. Not across the extension API boundary but if we measure at the point where a search provider is invoked, that will avoid a couple IPC hops that could be blocked when the computer is very busy. |
From my understanding, this is how it's supposed to work:
|
When I use Ripgrep, I get roughly 4 - 5 individual VSCode 1.29.0-exploration (observed this in insiders) |
Can you open a new issue with more details, because it's not clear what you mean and probably isn't relevant to this issue |
#34487 made one improvement by batching workspaceContains searches.
Keeping this one open to consider excluding .git and node_modules in a smart way, which could give a huge improvement.
cc @jrieken @alexandrudima
The text was updated successfully, but these errors were encountered: