Vscode-rust: Does nothing on Windows 10

Created on 19 Nov 2019  ·  11Comments  ·  Source: rust-lang/vscode-rust

I tried to use rls-vscode with VSCode, but failed horribly.

I actually re-installed the whole toolchain to make it work, but the extension does...well...nothing. It compiles my example file (I'm seeing the RLS stuff in the footer), but other than that...nothing.
The code is littered with intentional errors, but nothing gets highlighted. Code completion is not working as well.

I did not change any config and installed RLS from the popup that appears during first run.

I'd be happy to provide any additional information.

I'm using Windows 10 64-Bit, VSCode 1.40.1, rustc/cargo 1.39.0, rustup was installed today.

Thanks for all the work you guys do, I hope you can solve my issue, too.

Most helpful comment

I have the same issue described in the OP, or at least very similar. While debugging the issue, I discovered that if I disable the rust-client.enableMultiProjectSetup setting, everything works fine. @steps0x29a @Barsonax could you try this and see if the issue persists? (I'm not suggesting this as a fix, but it may help debug the issue.) @ildoc I could be wrong, but I think you might be experiencing a different issue.

I built the extension from source as described in the contributing document and added some logging/breakpoints so I can provide some more detailed information. This is what I found so far:

  • the SignatureHelpProvider is constructed, but its provideSignatureHelp method is never called
  • there's a conspicuous lack of communication between the VS Code extension and the RLS (with "rust-client.trace.server": "verbose"):

    • no textDocument/hover messages

    • no textDocument/codeAction messages

    • no textDocument/codeLens messages

    • no textDocument/documentSymbol messages

    • etc.

But I do see textDocument/publishDiagnostics messages, which explains why I still get squiggles for errors and error information on hover.

I can see provideSignatureHelp being called and all these messages being sent/received when I disable rust-client.enableMultiProjectSetup and everything works correctly then, so there must be something wrong here.

Interestingly, I _do_ get code completion/hover/intellisense/etc. with rust-client.enableMultiProjectSetup enabled in WSL through VS Code's remote WSL extension. (But there's a major issue with using VS Code with WSL 1 currently — repeated BSODs — which is why I'm trying to set up a Rust dev environment in Windows 10 itself.)

All 11 comments

try to run cargo check from your terminal, then show some log here pls

Not getting any intelisense as well...

❯ cargo check
   Compiling winapi v0.3.8
    Checking rand v0.4.6
    Checking advent-of-code-2019-rust v0.1.0 (C:\git\advent-of-code-2019-rust)
    Finished dev [unoptimized + debuginfo] target(s) in 4.87s

Seems to be fine?

EDIT: the intelisense sometimes works but sometimes it doesn't... Very weird.

after clicking "yes" in the install-rls popup, I get this in the terminal:

> Executing task: rustup component add rust-analysis --toolchain stable-i686-pc-windows-msvc <

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

c:\Projects\rust\guessing_game>

maybe the command is not escaped and fails on C:\Program Files[...] path


as a workaround, you can simply install rls by yourself with
rustup component add rls rust-analysis rust-src

I have the same issue described in the OP, or at least very similar. While debugging the issue, I discovered that if I disable the rust-client.enableMultiProjectSetup setting, everything works fine. @steps0x29a @Barsonax could you try this and see if the issue persists? (I'm not suggesting this as a fix, but it may help debug the issue.) @ildoc I could be wrong, but I think you might be experiencing a different issue.

I built the extension from source as described in the contributing document and added some logging/breakpoints so I can provide some more detailed information. This is what I found so far:

  • the SignatureHelpProvider is constructed, but its provideSignatureHelp method is never called
  • there's a conspicuous lack of communication between the VS Code extension and the RLS (with "rust-client.trace.server": "verbose"):

    • no textDocument/hover messages

    • no textDocument/codeAction messages

    • no textDocument/codeLens messages

    • no textDocument/documentSymbol messages

    • etc.

But I do see textDocument/publishDiagnostics messages, which explains why I still get squiggles for errors and error information on hover.

I can see provideSignatureHelp being called and all these messages being sent/received when I disable rust-client.enableMultiProjectSetup and everything works correctly then, so there must be something wrong here.

Interestingly, I _do_ get code completion/hover/intellisense/etc. with rust-client.enableMultiProjectSetup enabled in WSL through VS Code's remote WSL extension. (But there's a major issue with using VS Code with WSL 1 currently — repeated BSODs — which is why I'm trying to set up a Rust dev environment in Windows 10 itself.)

Seconding @mickdekkers observation about enableMultiProjectSetup, I saw the same behavior (no hover, no go-to-definition, etc.). Disabling that feature and reloading the window allowed everything to function as expected.

I also had an issue where autocomplete wasn't working however it was due to my firewall stopping the underlying components from downloading via rustup. When I looked at the plugin status it was showing as installed, however when I restarted Visual Studio Code, I got a notification that rls wasn't installed and would I like to continue. When I clicked yes and watched the output I could see that it was getting bounced by my firewall. After rejigging the firewall, rustup was able to successfully install rls and autocomplete started working.

Was this issue ever fixed? None of the hovering/etc is working for me (RLS warnings/errors only refresh when I "Restart the RLS").

I can't even try the workaround mentioned by @mickdekkers and @ChronosWS since "enableMultiProjectSetup" is apparently now permanently enabled in the newest version.

Note: I am also using the "Remote - WSL" plugin.

I ended up installing rust on my regular windows machine and reinstalled everything locally and now it seems to work.

It is probably an issue with WSL compatibility.

Same problem here, using Remote WSL. rls-vscode was working well for me a week ago. Today I run rustup update to get the new stable version of rust and rls-vscode stopped working for me.

  • Format Document fails with There is no formatter for 'rust' files installed.
  • Auto-completion does not work
  • Tests are not recognized

Native Windows toolchain works without any problems.

Same here. I get some linting but no autocomplete.
rqoykpdiTW

I'm learning Rust for the first time and I just thought autocomplete didn't work.
Turns out it's something funky with WSL or the VSCode extension.

So... why is this closed?

Was this page helpful?
0 / 5 - 0 ratings