Vscode-rust: Stop the RLS

Created on 14 Jun 2018  路  9Comments  路  Source: rust-lang/vscode-rust

It would be very nice to be able to stop the RLS. Sometimes I need to use VS Code to resolve merge conflicts, or do other clerical work, or I intend to run the project from command line for a little bit. I'd prefer to not have to close VS Code or use another editor in order to keep recompiles from happening. On my home computer it's not a big deal, but on my laptop the RLS can eat a lot of resources (to the point things like "typing in the terminal" lags) and a command to just kill it would help a lot.

This is especially problematic when dealing with git rebases and things like that because it tends to cause huge tree rebuilds of the project (especially in large workspaces) which constantly drop and restart because by the time it's done you've long moved on to the next step in a rebase (or whatever).

Apologies if there is a way to do this, but if VS code has a method for killing things beyond "terminate task" then I don't know where it is. Either way, I'd appreciate a more discover-able command along the lines of the "Restart the RLS" one.

enhancement

Most helpful comment

No response on my PR but I can probably package up my changes for others to use in some way. You can also build my fork from source if you make the change I mention in the PR (or not if you don't want to run rls at all).

All 9 comments

I've been wanting to have something similar also when working on a laptop and needing to conserve battery, then it is not ideal to have RLS running constantly in the background and building and checking the code. So for that use case I would like to temporarily stop it and build/verify manually. Would be nice.

Current workaround is to just disable the RLS extension and restart VSCode. Which is not the end of the world

I'm somewhat torn on this - it's weird requesting the extension to stop working short of disabling the extension itself. I guess we could implement this; the "Restart the RLS" command should spawn it again.

Disabling the extension would also remove build target extraction and other useful features.
Stopping just the RLS helps to conserve power use and memory: a few times I had my laptop lock up in swapping/overheated state with several Code windows opened on big Rust projects, all churning RLS instances.

Please get this fixed. I'm currently just learning Rust and I was having trouble with deleting the target directory from the command line... mysteriously, the target directory failed to be deleted every single time, and I realized what was going on after deleting it through vscode. The directory was regenerated, automatically, by the extension. So far I haven't found any setting to disable this behaviour. Hopefully, an option for the same would soon be added

Just ran into this poking through .cargo\registry... crev doesn't like the resulting 'unclean' repositories. As a workaround, --disable-extension can be useful, e.g.:

cargo crev open sourcefile --cmd "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\" --wait --disable-extension rust-lang.rust" --cmd-save

A case of this being helpful is when developing rust itself. RLS doesn't handle rustc well, and so being able to disable RLS for only that workspace would be v helpful

I'd like to also request a settings that stops RLS being started without manually being triggered. For me manually starting RLS when needed would be far easier than the effort required to avoid/cleanup after its CPU/RAM/disk usage currently.

It's a fairly common case for me to have multiple libraries open that I need to reference but am not actively working on. Running rls instances for three libraries results in 3-4GB of disk usage and 1.5+GB of RAM usage on top of the actual project I'm working on (not to mention the number of separate times something may need to be built if I actually change anything in a library). On my machine (128GB disk, 8GB RAM) that's pretty non-trivial, especially since they stick around for multiple projects if I need to switch between them.

If I open up an old project to check something I usually don't want to trigger a build of the entire dependency tree (and leaving the target directory around isn't really an option due to disk space constraints). As mentioned this makes basic things like typing in vscode slow, not to mention rebuilding the project I'm actually working on.

When I have something that only works in nightly the errors and animation that never stops in the vscode status bar (mostly the animation) get pretty annoying.

I may try taking this on myself. Any pointers on where the code currently handles starting the RLS would be welcome.

Any solutions???? fking stupid auto-building, it's too slow, and introduce a new error

Blocking waiting for file lock on package cache

No response on my PR but I can probably package up my changes for others to use in some way. You can also build my fork from source if you make the change I mention in the PR (or not if you don't want to run rls at all).

Was this page helpful?
0 / 5 - 0 ratings