Skip to content

Instantly share code, notes, and snippets.

@5t111111
Created June 16, 2018 04:26
Show Gist options
  • Save 5t111111/ba8b318ce6c43273a54181838b1d85ca to your computer and use it in GitHub Desktop.
Save 5t111111/ba8b318ce6c43273a54181838b1d85ca to your computer and use it in GitHub Desktop.
VSCode Rust Setup

Install RLS (Rust Language Server)

You have to setup nightly release channel toolchain.

rustup install nightly
rustup update nightly
rustup component add --toolchain=nightly rls-preview rust-analysis rust-src

Note: You don't have to set nightly as a default channel. In general, RLS works on stable channel when nightly toolchain is installed.

Setup VSCode

Install plugins

code --install-extension rust-lang.rust

If you do not have code command, see https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line

Autoformat settings

Open preferences in VSCode (command + ,) and add the following to the configuration:

    "[rust]": {
        "editor.formatOnSave": true
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment