rust-lang / rust-lang/rust-analyzer

Rust-analyzer raises an error when opening a project in WSL2

Open
#10,893 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-support
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I have my rust development environment on top of WSL2 (kali-linux). After installing rust-analyzer from the marketplace in VSCode, I got this error on the hovering toast so that I cannot go forward.
rust-analyzer failed to load workspace: No such file or directory (os error 2)

Does the problem happen because rust toolchain is built on WSL2? If so, how do I solve it?
I've done a preliminary search about some relevant issues but I cannot find the answer yet.

Thanks in advance.

DESKTOP-J74E4AM$ cargo --version
cargo 1.55.0 (32da73ab1 2021-08-23)

DESKTOP-J74E4AM$ rustc --version
rustc 1.55.0 (c8dfcfe04 2021-09-06)

DESKTOP-J74E4AM$ uname -a
Linux DESKTOP-J74E4AM 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux

My VSCode setup:

Version: 1.62.3 (user setup)
Commit: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
Date: 2021-11-17T08:11:14.551Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

My rust-analyzer version:

rust-analyzer version: d9b2291f5 2021-11-29 stable

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the workspace-load failure using the reported WSL2, Rust 1.55, VS Code 1.62.3, and rust-analyzer d9b2291f5 setup, then identify the missing path and document a verified fix or regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust, vscode
Domain
developer-experience, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.