rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

Some compiler errors are not highlighted in editor (vscode)

Open Lexey40o opened this issue 2 years ago • 0 comments

rustc --version: rustc 1.71.1 (eb26296b5 2023-08-03) rustlings --version: v5.5.1 OS: Microsoft Windows 10 Home 10.0.19045 Build 19045 rust-analyzer vscode plugin version: v0.4.1627 vscode version: 1.81.1

ls -la

total 29597
drwxrwxrwx 1 user user     512 Aug 17 22:16 .
drwxrwxrwx 1 user user     512 Jul 28 12:07 ..
-rwxrwxrwx 1 user user   59202 May 17 13:09 .all-contributorsrc
drwxrwxrwx 1 user user     512 May  2 12:35 .devcontainer
-rwxrwxrwx 1 user user     109 May  2 12:35 .editorconfig
drwxrwxrwx 1 user user     512 Aug 17 16:54 .git
drwxrwxrwx 1 user user     512 May  2 12:35 .github
-rwxrwxrwx 1 user user     224 May 17 13:09 .gitignore
-rwxrwxrwx 1 user user     169 May  2 12:35 .gitpod.yml
-rwxrwxrwx 1 user user      61 May 17 13:09 .markdownlint.yml
drwxrwxrwx 1 user user     512 May  2 12:35 .vscode
-rwxrwxrwx 1 user user   76274 May 17 13:09 AUTHORS.md
-rwxrwxrwx 1 user user   47175 May 17 13:09 CHANGELOG.md
-rwxrwxrwx 1 user user    4301 May  2 12:35 CONTRIBUTING.md
-rwxrwxrwx 1 user user   19047 May 17 13:09 Cargo.lock
-rwxrwxrwx 1 user user     616 May 17 13:09 Cargo.toml
-rwxrwxrwx 1 user user    1117 May  2 12:35 LICENSE
-rwxrwxrwx 1 user user    6720 May 17 13:09 README.md
drwxrwxrwx 1 user user     512 May  2 12:35 exercises
-rwxrwxrwx 1 user user    1572 May  2 12:35 flake.lock
-rwxrwxrwx 1 user user    2032 May 17 13:09 flake.nix
-rwxrwxrwx 1 user user   43455 May 17 13:09 info.toml
-rwxrwxrwx 1 user user    3116 May  2 12:35 install.ps1
-rwxrwxrwx 1 user user    4846 May  2 12:35 install.sh
-rwxrwxrwx 1 user user     212 May 17 13:09 oranda.json
-rwxrwxrwx 1 user user    9082 Aug 17 22:38 rust-project.json
-rwxrwxrwx 1 user user     284 May  2 12:35 shell.nix
drwxrwxrwx 1 user user     512 May 17 13:09 src
drwxrwxrwx 1 user user     512 Aug 17 22:17 target
-rwxrwxrwx 1 user user 1437696 May  2 12:59 temp_13664_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Jul 17 21:33 temp_14188_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Aug 17 21:39 temp_14824_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 May 17 12:58 temp_16652_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Jul 17 21:22 temp_18980_ThreadId1.pdb
-rwxrwxrwx 1 user user 2699264 May  2 15:10 temp_19512_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Aug 17 21:53 temp_20004_ThreadId1.pdb
-rwxrwxrwx 1 user user 1437696 May  2 13:56 temp_20164_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Aug 17 16:48 temp_21876_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 Jul 15 15:54 temp_24296_ThreadId1.pdb
-rwxrwxrwx 1 user user 2699264 May  3 19:07 temp_26588_ThreadId1.pdb
-rwxrwxrwx 1 user user 2715648 May 17 13:18 temp_3312_ThreadId1.pdb
drwxrwxrwx 1 user user     512 May  2 12:35 tests

When going through exercise enums3.rs, I noticed that certain errors won't be highlighted in the editor (vscode), but will be caught by rustlings run enums3. Here's a modified version of enums3.rs that contains errors which should be highlighted but are not. An interesting bit is that if you delete not_an_inscope_variable, I do get error highlighting for the wrong number of arguments error (E0107).

I'm guessing this has to do with the relationship between the unique project structure of rustlings and the rust-analyzer plugin. I was not able to reproduce this problem inside a project with a normal structure, as the errors were appropriately highlighted inside the editor.

If this turns out to be a rust-analyzer problem, I'd be happy to open an issue there.

Lexey40o avatar Aug 18 '23 19:08 Lexey40o