Doesn't load new workspace
Please first note that this is not a duplicate of https://github.com/rust-lang/rust-analyzer/issues/17739.
I am a beginner so this question may be silly.
When I created a new project with cargo new tutorial and this is my dir:
.
├── Cargo.lock
├── Cargo.toml
├── src
└── main.rs
(omitting target/)
And I cannot use rust-analyzer in VScode There may be an answer on the internet, but I googled for hours and did not find any. Please help, thanks a lot in advance.
More info if this helps: on WSL2, ubuntu 22.04
(playground) ‹da1sypetals@LAPTOP-P07PKIRG›
/mnt/a/dev/rs/tutorial > cargo --version
cargo 1.80.0 (376290515 2024-07-16)
(playground) ‹da1sypetals@LAPTOP-P07PKIRG›
/mnt/a/dev/rs/tutorial > rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.80.0 (051478957 2024-07-21)`
(playground) ‹da1sypetals@LAPTOP-P07PKIRG›
/mnt/a/dev/rs/tutorial > rust-analyzer --version
rust-analyzer 1.80.0 (0514789 2024-07-21)
Duplicate of https://github.com/rust-lang/rust-analyzer/issues/17739, but you can ignore the error.
Duplicate of #17739, but you can ignore the error.
No I cannot, since the rust-analyzer plugin just does not work without this resolved, and I don't get code hints/intellisense. I have also read that issue inside-out, without getting a solution.
Okay, but it's still a duplicate of that issue, and you can work around it by adding a .cargo/config.toml file with a single [env] line.
Actually no, there's no reason why the missing file would cause a problem...
I can confirm that this is only a cosmetic issue:
Do you have any other errors?
I can confirm that this is only a cosmetic issue:我可以确认,这只是一个外观问题:
Do you have any other errors?还有其他错误吗?
I have the same situation, adding [env] does not work, and it is not just a cosmetic issue in my case. Three months ago version available
Okay, but it's still a duplicate of that issue, and you can work around it by adding a
.cargo/config.tomlfile with a single[env]line.
If what you mean is the following screenshot, it does not resolve the problem:
And the same as the previous comment, this in my case is not a cosmetic issue, since it make the plugin not functioning, not even giving hints for std stuffs. (I typed use s and nothing shows up`)
@Da1sypetals
If what you mean is the following screenshot, it does not resolve the problem
Do you still get the same error message? I assume you did restart r-a or VS Code after creating the file.
What does RUSTC_BOOTSTRAP="1" RUSTUP_TOOLCHAIN="/home/da1sypetals/.rustup/toolchains/stable-x86_64-unknown-linux-gnu" "/home/da1sypetals/.cargo/bin/cargo" "-Z" "unstable-options" "config" "get" "env" for your project?
I typed use s and nothing shows up
You need to press Ctrl-Space or type use std:: to trigger a completion there.
Anyway, please install the pre-release version (0.4.2057 or newer), that includes a fix for the cosmetic issue, and see if it works afterwards:
@Haif-07
Three months ago version available
Not sure what you mean, but you can also install the pre-release version.
I've just experienced this bug with https://github.com/pop-os/libcosmic. I'm using Fedora 40
Updating to our pre-release version resolves this issue. If there are other problems I would suggest opening a separate issue.
@Da1sypetals what is the output of running the Show RA version command in VSCode?
To everone coming here regarding the env error, that one can be ignored it has no effect on anything.
