rustlings: Bug: `rustlings lsp` not working with latest `rust-analyzer` VS Code Extension version.

Issue

On the latest version of the rust-analyzer extension (v0.3.1463), the rust-project.json that is generated from running rustlings lsp is seemingly ignored. IntelliSense, autocomplete, etc., cannot be used despite the rust-project.json being generated and rust-analyzer extension being enabled.

Temporary Solution

Roll back rust-analyzer extension version to v0.3.1451.

How to Replicate

System Details

rust-analyzer VS Code Extension version: v0.3.1463

rustc --version

rustc 1.68.2 (9eb3afe9e 2023-03-27)

rustlings --version

v5.4.1

ls -la

total 20365
drwxr-xr-x 1 josep 197609       0 Apr  4 07:58 ./
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 ../
-rw-r--r-- 1 josep 197609   53199 Apr  2 10:29 .all-contributorsrc
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 .devcontainer/
-rw-r--r-- 1 josep 197609     109 Apr  2 10:29 .editorconfig
drwxr-xr-x 1 josep 197609       0 Apr  3 05:56 .git/
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 .github/
-rw-r--r-- 1 josep 197609     179 Apr  2 10:29 .gitignore
-rw-r--r-- 1 josep 197609     169 Apr  2 10:29 .gitpod.yml
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 .vscode/
-rw-r--r-- 1 josep 197609   69063 Apr  2 10:29 AUTHORS.md
-rw-r--r-- 1 josep 197609   17152 Apr  2 10:29 Cargo.lock
-rw-r--r-- 1 josep 197609     533 Apr  2 10:29 Cargo.toml
-rw-r--r-- 1 josep 197609   45620 Apr  2 10:29 CHANGELOG.md
-rw-r--r-- 1 josep 197609    4301 Apr  2 10:29 CONTRIBUTING.md
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 exercises/
-rw-r--r-- 1 josep 197609    1572 Apr  2 10:29 flake.lock
-rw-r--r-- 1 josep 197609    2032 Apr  2 10:29 flake.nix
-rw-r--r-- 1 josep 197609   42700 Apr  2 10:29 info.toml
-rwxr-xr-x 1 josep 197609    3116 Apr  2 10:29 install.ps1*
-rwxr-xr-x 1 josep 197609    4846 Apr  2 10:29 install.sh*
-rw-r--r-- 1 josep 197609    1117 Apr  2 10:29 LICENSE
-rw-r--r-- 1 josep 197609    6667 Apr  2 10:29 README.md
-rw-r--r-- 1 josep 197609    8996 Apr  4 07:56 rust-project.json
-rw-r--r-- 1 josep 197609     284 Apr  2 10:29 shell.nix
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 src/
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 target/
-rw-r--r-- 1 josep 197609 2748416 Apr  3 05:55 temp_104912_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2732032 Apr  2 20:19 temp_106948_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2748416 Apr  4 07:58 temp_37868_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2732032 Apr  2 11:49 temp_49388_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2732032 Apr  2 20:21 temp_54464_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2732032 Apr  2 20:21 temp_86324_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 2732032 Apr  2 20:21 temp_88736_ThreadId1.pdb
-rw-r--r-- 1 josep 197609 1355776 Apr  2 10:31 temp_99564_ThreadId1.pdb
drwxr-xr-x 1 josep 197609       0 Apr  2 10:29 tests/

OS name and version: Windows 11 Pro, 22H2, Build 22621.1413

this is probably better suited for rust-lang/rust-analyzer but I’m still learning Rust 😓

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 15
  • Comments: 19 (10 by maintainers)

Most upvoted comments

It’s not an issue on our end, the rust-project.json specification hasn’t changed afaik (if it did, it’d break on non-Windows platforms as well). I’m not sure what the rust-analyzer developers’ timeline or understanding of this issue is, though.

I am also having this issue with rust-analyzer v0.3.1472. Downgrading to v0.3.1451 solved the issue for me as well

Hi all,

Trying rustlings out and this bug is happening to me in 5.6.1.

Relevant information: OS: Ubuntu 22.04 rustlings: 5.6.1 rustc --version: rustc 1.74.0 (79e9716c9 2023-11-13) rust-analyzer extension: Bug in both

  • v0.3.1748
  • v0.4.1753 (pre-release)

Steps to replicate:

  • Install rustlings
  • Run rustlings lsp
  • In VS Code attempt command pallet command rust-analyzer: Restart server (no change)
  • Restart VS Code (no change)

Any other steps anyone can think of?

Perfect, closing it for real now

Ah, the problem is the UNC path I believe (the \\\\?\\ prefix). Our VFS will have a non UNC path indexed so it won’t be able to resolve this properly. I assume you are using rust’s path canonicalize function somewhere to get the absolute path which unfortunately returns UNC paths on windows … That said, and I am sorry for not having brought that up here again afterwards but relative paths should just work again. We effectively ended up reverting the changes and took a stance for the current behavior now (as before we weren’t sure which one we really wanted to stick with).

There is no decent way for us to handle different paths pointing to the same thing here unfortunately, s owe can’t really do anything about unc paths and just opt to not support them currently.

Seems like https://github.com/rust-lang/rust-analyzer/issues/14663 has been posted, backlinking it here to help those in that issue.