-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust-analyzer error on pre-release branch of vscode extension #11493
Comments
It looks like your rustup installation doesn't have a default toolchain configured. Try running |
Unfortunetly it allready settled to stable |
Does |
|
Do you still have |
I settled the path like this:
|
Maybe you have two versions of Rust installed, one through |
I settled
|
Oh, i forgot to mention: My Debian has just one cargo from rustup. |
You shouldn't need to set |
|
What if you do |
|
|
The output of So is it's not from a package and it's not a symlink (or is it?), where did |
You misundestood. I dualboot Debian & Arch. In Debian I installed rustup via rust's site. In Arch I installed from pacman. |
|
Then does this problem happen when you're booting Debian or Arch? Does it work if you remove the |
I got this error both of them. |
For me, I'd try to remove the installed version(s) and environment variables, then start over. |
I HATE keeping these things on my home folder. It was not a problem 3 days ago and it was still settled to |
Okay, you should have mentioned that in the original post. I'll update the issue template to ask for customizations like this. Did you try to run Code from the terminal? If you're using a DE and you're setting In any case, I don't think we've tested this configuration. There is some auto-detection for |
Oh wait: I symlinked
|
Did you try to run Code from the terminal? It worked! But |
Anyways symlink is working too! I don't know why did it give error when my first try, but it worked! |
In your setup? I don't know. If you want to make environment variables visible to Code, you can set them in a |
So.. what do you think will they get a bugfix about this bug ("rust-analyzer doesn't detect when using alternative paths")? |
What do you mean by "they"? Anyway, rust-analyzer appears to work when using alternate paths, but only if you configure them properly. If you only set those environment variables for the shell, rust-analyzer has no way of knowing about them. |
Nevermind.
Yes it was great with alternate parhs but it suddenly stopped working. |
Looks like the problem was solved, so I think we can close this? |
I read that as "not solved", but.. |
Hello, I reproduce this small issue on Debian. Indeed bash has the path but not VsCode through Gnome menu when cargo is elsewhere than default path.
I tried ~/.profile and /etc/environment with
I tried a bit eveything with the config
gives
I tried also with a symlink to /opt/ from my user folder but no luck. I can live with opening VsCode in a shell but I don't figure out why this environment var is not defined. Cheers thanks |
@gRoussac what if you also set |
You don't need the |
Hi, thanks So I tried
gives and
gave back
(No $ in the file sorry I was meaning shell prompt, I'll change my comment) |
What about |
well my bash seems fine, and opening code in it does the trick, that is how I noticed anaylser was somehow not working through gnome panel.
so it's really a matter of giving CARGO_HOME to VSCode from outside a shell. |
I'm not sure, then. I would check that |
thanks
|
You were well refering to this process right ?
|
I meant the |
I tried to remove the json config and set the CARGO env var in /etc/environment.d/90cargo-path.conf which seems fine but no luck neither. Other processes have also those var.
|
Yeah, so the environment variables appear to be correct. Maybe there's another factor involved, one we haven't thought of? As a side note, if possible, you should stay on the happy path of using From what I've seen, custom setups often become massive support time sinks, not only for us, but presumably also for the users themselves. For example, both the original bug report here and the recent #11673 arose from wrong expectations about how environment variables work.
Oh, this is new. It sounds like you don't have a default toolchain installed. I think I've recently seen someone say that removing and reinstalling their current toolchain fixed it. |
Yeah that is the answer to that error normally but then I still don't get it.
I fully understand what you mean, it's not a big issue, I just put stuff in opt because my home. I was expecting the symlink to work. |
Maybe you also need |
Works. Thank you so much for your help, let's go back to work. |
I had this issue - it was because I'm using WSL to run an Ubuntu command line in Windows and VS Code in Windows itself (doh). |
For me I had this issue after renaming a package which was named in the "rust-analyzer.linkedProjects" setting. After updating the issue wwas resolved. |
This fixed my issue. I had cargo installed in another path rather than Adding this to "rust-analyzer.server.extraEnv": {
"RUSTUP_HOME": "/home/alex/.local/rustup",
"CARGO_HOME": "/home/alex/.local/cargo"
}, |
rust-analyzer version:
rust-analyzer 2022-02-14
(installed via pacman)rustc version:
rustc 1.58.1 (db9d1b20b 2022-01-20)
(installed via rustup and branch is stable)Hello! I am taking this error on vscode.
I am using pre-release of vscode extension, that's why i open a issue despite your info about it.
I tried adding
CARGO
path but it didn't work.I hope it'll be helpful bug report for you!
The text was updated successfully, but these errors were encountered: