Open adamh-oai opened 1 month ago
@hauntsaninja said I should tag @dhruvmanila since you've been talking about this.
Thanks! I'll need to try to reproduce this somehow using a large repository, maybe I'll pickup home-assistant/core for this.
Looks like ours is about 5x larger than home-assistant/core. I can reproduce this pretty easily, if you want to give me something to test. A few other details:
Both this and the 50-copies-of-rg issue sort of feel like VSCode is triggering a whole bunch of update notifications and they queue up somewhere and then are processed even though they all represent the same change.
@adamh-oai is there a high likelihood that each pull changes some pyproject.toml?
Both this and the 50-copies-of-rg issue sort of feel like VSCode is triggering a whole bunch of update notifications and they queue up somewhere and then are processed even though they all represent the same change.
That's what I suspect as well
If they're representing the same changes, then there's a chance that VS Code must be sending the cancel requests as well (as also noted in your logs). It might become important to implement that in the server although I'd need to verify.
@dhruvmanila this hits us pretty regularly, is there anything I can test to narrow it down?
@dhruvmanila I wonder if it's time to change our settings discovery to be lazy instead of doing it eagerly. It would not only help with the single file case but also reduce the indexing cost here because the LSP would only ever discover the settings for the files currently open in the editor instead of all settings (and only traverse upwards, but never downwards)
Yeah, I think we might want to prioritize that. And, even if we add support for cancellation, lazy settings discovery would still be more beneficial comparatively.
I experimented a bit using home-assistant/core
and I think we might be re-indexing the entire project multiple times.
@adamh-oai Can I know how many Ruff configuration files exists in your project? It could be either pyproject.toml
/ ruff.toml
/ .ruff.toml
.
We have well over a thousand pyproject.toml in the repo, only about 150 of which contain tool.ruff
. It's common to have a per-project ruff setup that extend
-s from the root ruff config. Looks like there are two ruff.toml
Thanks, that's very useful. I think we've narrowed down the problem and will be working towards a fix for it.
This is still on our mind. I'm planning to pick it up either next or the following week.
In our large mostly-python monorepo, when using the VSCode ruff extension + ruff server, if I update to a commit has many changed files,
ruff server
will consume lots of CPU (up to 1000% in some cases), and I cannot save in VSCode because it is blocked on "Getting code actions (..., "Ruff")".Sample of debug logs:
There are lots and lots of the "ignored", which isn't surprising since I run with a config that excludes most paths in the repo.