lapce / lapce-rust

Apache License 2.0
80 stars 26 forks source link

Rust analyzer version is hardcoded #29

Closed akhildevelops closed 1 year ago

akhildevelops commented 1 year ago

Currently the rust analyzer version is hard coded and there's no way to use latest release.

akhildevelops commented 1 year ago

https://github.com/lapce/lapce-rust/blob/02d3a760137caf815f6c028b738f5ad58bf3c58a/src/main.rs#L93

panekj commented 1 year ago

There is no latest version, you should use rustup component add rust-analyzer and use absolute path to RA in plugin settings if you want version that is "latest"

akhildevelops commented 1 year ago

I think that's tedious and boring.

This link https://github.com/rust-lang/rust-analyzer/releases/latest/download/rust-analyzer-aarch64-unknown-linux-gnu.gz everytime points to latest release of rust-analyzer

panekj commented 1 year ago

And I think downloading always newest version is lazy and unstable.

akhildevelops commented 1 year ago

I agree that latest release can be buggy. But a fixed version wouldn't help either as the analyzer might get outdated, doesn't get fixes for the bugs.

I've a suggestion, let the user decide on the version he wants to install from plugin settings, if not mentioned it will always point to latest (i.,e defaults to latest). What do you think ?

akhildevelops commented 1 year ago

I understand now what do you meant by no latest. I was thinking that rust-analyzer is independent to rustc and haven't known that rustup can be used to install compatible rust-analyzer depending on the rust toolchain.

Why can't we use rustup to install rust-analyzer and then set the path ? After adding rust-analyzer using rustup component add rust-analyzer we can get the path by rustup which rust-analyzer based on the active toolchain.

❯ rustup which rust-analyzer
/home/akhil/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rust-analyzer

Let me know if you are interested in this idea, I'll try to give a PR

panekj commented 1 year ago

Why can't we use rustup to install rust-analyzer and then set the path ?

It wasn't possible before.

we can get the path by rustup which rust-analyzer

I'm aware of that but we don't have a way yet to get command output in plugins.

akhildevelops commented 1 year ago

I'm aware of that but we don't have a way yet to get command output in plugins.

I.e, because plugin runs as wasi binary ?

akhildevelops commented 1 year ago

Closing this as there's no proper way to configure rust analyzer version