rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Start rust-analyzer vs-code plugin in a stopped state

Open Daanoz opened this issue 1 year ago • 5 comments

One of my current projects involves a large mono-repo with mostly other programming languages than rust. At the moment we are slowly introducing rust to this repo. We use a devcontainer to get a similar development environment for all users.

It would be great if the rust-analyzer vs code extension could start in a "stopped" state, this allows any developer doing rust to activate it if needed, and other developers will not be bothered by the resource consumption. Especially during start-up, we see that all projects are preloaded which consumes quite some resources.

Daanoz avatar Oct 21 '24 08:10 Daanoz

I wonder what the best approach here would be, probably to start stopped and start if a rust file / Cargo.toml has been opened (and we havent started once this session yet)? Once we have lazy loading this would ultimately become the experience for this anyways I think

Veykril avatar Oct 21 '24 08:10 Veykril

I did a rough attempt to do an implementation: https://github.com/Daanoz/rust-analyzer/commit/928ea2e8fbb89531925f803d7d91e7856ffdfba7. But I'm running into some npm issues to actually test it properly. Do I understand it correctly that it doesn't really make sense to add this since another feature would make this obsolete?

Daanoz avatar Oct 21 '24 09:10 Daanoz

Nono, it would make sense to add this (the lazy loading stuff I've mentioned is something we want to have in the future), i mentioned that because we will have this kind of behavior by that point anyways (to argue that the change makes sense)

Veykril avatar Oct 21 '24 09:10 Veykril

And we'd want a config either way (like in your commit) so that would be welcome

Veykril avatar Oct 21 '24 09:10 Veykril

Alright, then I'll work on testing it so I can make a PR.

Daanoz avatar Oct 21 '24 09:10 Daanoz

Implemented in #18359.

lnicola avatar Oct 25 '24 13:10 lnicola