lapce / lapce-rust

Apache License 2.0
80 stars 26 forks source link

plugin rust set RA path turn on error #26

Closed zhouxs1023 closed 1 year ago

zhouxs1023 commented 1 year ago

os: windows 10 RA path C:\Users\Administrator.vscode\extensions\rust-lang.rust-analyzer-0.3.1435-win32-x64\server\rust-analyzer.exe

lapce rust plugin server path set as below: rust set

open rust project turn error as below: rust-plugin error

catb0t commented 1 year ago

Even though it is called "path" the value is passed to where on Windows

so we have to provide a non-absolute path resolvable by where

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

my solution was to have ~/bin in my PATH already, and then:

> mklink C:\users\%USERNAME%\bin\win-nightly-rust-analyzer.exe C:\Users\%USERNAME%\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\rust-analyzer.exe
symbolic link created for ....

> where win-nightly-rust-analyzer.exe
C:\Users\%USERNAME%\bin\win-nightly-rust-analyzer.exe

then put win-nightly-rust-analyzer.exe as the "Server path" in the plugin settings for now

zhouxs1023 commented 1 year ago

Cat Stevens, Thanks you very much, The problem has already been solved.