rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.34k stars 1.62k forks source link

rust-analyzer silently download dependencies #18455

Closed Yuuki1578 closed 3 weeks ago

Yuuki1578 commented 3 weeks ago

Does the rust-analyzer now need some dependencies to work with? When i use rust-analyzer at August 2024 or later that (before october, i dont know the version), it work just fine without internet connection. I use it now without internet connection and the hover output from editor looks like this:

Image

I know that the String type is included in the prelude, but somehow rust-analyzer is unable to find the type.

And when i turn the internet connection on and restart the LSP inside the editor, rust-analyzer will download extra dependecies, like:

Image

platform: Termux aarch64 android

rust-analyzer version: 0.0.0

rustc version: rustc 1.82.0 (f6e511eec 2024-10-15) (built from a source tarball)

editor or extension: Helix

code snippet to reproduce:

rust-analyzer # invoked by helix
ChayimFriedman2 commented 3 weeks ago

I believe what changed is in rust, not in r-a, that stdlib has a proper Cargo project now so rust-analyzer can index it properly, which means it's downloading std's dependencies.

lnicola commented 3 weeks ago

We also run rustup component add rust-src if it's not available. I don't think it's such a big deal.