rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

RLS stuck on indexing #748

Open izderadicka opened 4 years ago

izderadicka commented 4 years ago

From time time time RLS got stuck on indexing - see screenshot of status bar image

then action RUST: Restart RLS is not working, neitheir manual kill of rls. Only restart of VS code.

I looked bit in logs but did found anything useful - looks like something related rather to VSC and extension then to rls - as rls restart does not help?

Using VSC 1.42.1, Rust extension 0.7.0, rls - rls 1.41.0 (5fde462 2020-02-21) and OS is Ubuntu 18.04.

borsboom commented 4 years ago

I am experiencing the same problem. Using VSC 1.43.1, Rust extension 0.7.0, rust 1.41.0-x86_64-apple-darwin and OS is macOS Mojave 10.14.6.

SLMT commented 4 years ago

Same problem here. The version of VSCode is 1.43.2 with Rust extension 0.7.0 and Rust 1.41.1 toolchain on macOS Mojave 10.14.4.

anweiss commented 4 years ago

Also running into the same issue.

borsboom commented 4 years ago

After being frustrated by this for a few days, I switched over to the rust-analyzer extension. It's working great, is much faster, and has a bunch of extra features.

thethomasboyer commented 4 years ago

Same here, with VSCode 1.43.2, rls 1.41.0 (b27e117 2020-01-13), rustc 1.42.0 (b8cedc004 2020-03-09), and Rust (rls) extension 0.7.0 on Linux x64 5.3.0-42-generic.

HalfVoxel commented 4 years ago

Same with rls extension 0.7.3, rls 1.41.0, rustc 1.44.0-nightly.

nlfiedler commented 4 years ago

Happens to me every few minutes: extension 0.7.3, rls 1.41.0, rustc 1.43.0

SLMT commented 4 years ago

Update: I moved to rust-analyze as well. It performs much faster without this kind of issues.

izderadicka commented 4 years ago

Still problem, however RLS seems to be working - errors are detected etc. But indexing indicator is rolling - definitely annoying

nlfiedler commented 4 years ago

Thanks to the earlier comments, I also switched to rust-analyzer; it's different, but it does work very well and offers other neat features.

A point that I think has not been made yet about this issue is that when the rls spinner is stuck on "indexing", the tool-tip (variable type) hints stop working.

Xanewok commented 4 years ago

I debugged this a bit and it seems that this happens when the analysis database thread panicks for some reason - we don't ever finish indexing in that case but we handle our builds and diagnostics just fine.

This will need further work on the RLS itself. By the way, do you have a concrete, reliable reproduction case? I only managed to reproduce these failures by accident and couldn't find a reliable way to reproduce this.

nlfiedler commented 4 years ago

It often happens for me when I'm typing crappy code. While I'm in the middle of writing some code, it's typically uncompilable junk, and the rls seems to die because of it.

rabe42 commented 4 years ago

Even code without any issues is indexing forever on my site. The restart of VScode is not providing any release in this case. No solution since three versions available.

ChrisWhealy commented 4 years ago

Any movement here? I'm still getting this problem on VSCode 1.48.2 (on Mac) and rustc 1.46.0 (04488afe3 2020-08-24)

ckmercantile commented 4 years ago

Still happening

tensor-programming commented 3 years ago

Got the same issue myself. Swapped to the analyzer and tried the nightly (same issue) but they both have their own downsides.

jkelleyrtp commented 3 years ago
pkill -f cargo

Will release the lock on the target directory.

iiiMatt commented 3 years ago

Same issue

a3y3 commented 3 years ago

I started getting this issue too - Ctrl+Shift+P and Restart Rust Server seems to be a workaround, but it gets annoying to having to do this quite often.

a3y3 commented 3 years ago

Turns out this is an issue of the Rust extension. I switched to rust-analyzer and it's faster, lighter, and seems to have a ton of more features compared to Rust extension : and it doesn't get stuck in "indexing".

ArtemGr commented 3 years ago

rust-analyzer takes a lot of time to index stuff which is very annoying when a part of the project isn't even in Rust. And it fails to discover some of the projects, there is an open bug about this. And, using an independent parser, as of 2021-10 it does not support type ascription.

I ended up disabling both extensions and enabling one or the other on a per-workspace basis.

rust-analyzer and it's faster, lighter, and seems to have a ton of more features

On one of my projects rust-analyzer is stuck indexing dependencies in an infinite loop, until eventually it goes out of memory. So it isn't like one fails and other is all sunshine and rainbows.

Clearly some different design decisions has been made between the two. Rust extension might be much lighter and faster if you take the rust-analyzer dependency indexing into account. Seems that Rust extension does a lot of work on demand, whereas rust-analyzer tries to prepare beforehand, which makes the moment-to-moment code editing with rust-analyzer much heavier.

Narasimha1997 commented 3 years ago

Facing the same issue. The indexing thread never terminates and runs in an infinite loop simply wasting resources. I switched to rust-analyzer, the plug-in is in alpha state, but works cool.

lnicola commented 3 years ago

I wouldn't read too much into the "the project is in alpha status" warning on the VS Code Marketplace.