Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 300
Lukas Avatar asked Oct 09 '20 19:10

Lukas


People also ask

How do I turn on autocomplete in Visual Studio?

The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space . If necessary, you can always return to the Visual Studio's native's IntelliSense. To do so, select Visual Studio on the Environment | IntelliSense | General page of ReSharper options ( Alt+R, O ).

Why is my IntelliSense not working?

If IntelliSense is not working as it should on your Windows 11/10 PC, you can try restarting VS Code and this should solve the issue. Restarting the program can be really effective and time saving in some cases. If the issue persists, you can try restarting your computer altogether.


1 Answers

For me solution was to use Rust Analyzer extension https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer instead of https://marketplace.visualstudio.com/items?itemName=rust-lang.rust

like image 128
Lex Avatar answered Oct 03 '22 04:10

Lex