Search code examples
visual-studio-coderustautocomplete

Rust Visual Studio Code code completion not working


I'm trying to learn Rust and installed the Rust extension for VSCode. But I'm not seeing auto-completions for any syntax.

I'd like to call .trim() on String but I get no completion for it. I read that the completion for Rust isn't great, but the Language Server should be able to recommend methods that can be called on a struct?

I also saw a tutorial where the tutor had autocompletion in VSCode but I don't know what extension he was using.

I also tried it in WSL and thought that WSL was the problem, but after also installing Gigabytes of Visual Studio Build Tools it turns out it's also not working natively on Windows.

enter image description here


Solution

  • As mentioned in dustypomerleau/rust-syntax issue 4, since Nov. 2020, the grammar is merged into Rust Analyzer, and RA's grammar overrides others when it starts.

    The completion should improve, and the microsoft/vscode issue 64488 "Need a better grammar support for Rust lang" just got closed (Dec. 2020) as a result.