上QQ阅读APP看书,第一时间看更新
Installing Visual Studio Code and extensions
In its vanilla version, Visual Studio Code comes with syntax highlighting for many languages. However, for autocompletion or/and checking syntax, an extension is required. The Rust project supplies this extension:
- Open Visual Studio Code.
- Use Ctrl + P (cmd + P on macOS) to open the command-line interface, then type ext install rust-lang.rust to install the extension. The process should look like this:
The extension uses RLS to do static code analysis and provide completion and syntax checking. The extension should install the RLS component automatically, but sometimes it will fail to do this. One solution is to add the following configuration to Visual Studio Code's settings.json file (use Ctrl + P/cmd + P to find it):
{
"rust-client.channel":"stable"
}
Alternatively, rustup will also install RLS with the rustup component add rls command.