Rust language server (Rust Analyzer)

Tips and information on how to install and use language servers with the editor.
Post Reply
User avatar
Rickard Johansson
Site Admin
Posts: 6566
Joined: 19 Jul 2006 14:29

Rust language server (Rust Analyzer)

Post by Rickard Johansson »

Rust Analyzer
At its core, rust-analyzer is a library for semantic analysis of Rust code as it changes over time. But it's also used as a server that implements the Language Server Protocol (LSP).

Install
* Install Rust from https://rustup.rs.
* Install Rust-Analyzer

Code: Select all

  From command prompt (as administrator?) run
    >rustup component add rust-analyzer
Add the server in project/sites settings

Server name
Rust language server

Command
rust-analyzer.exe

Initial folder
%homepath%\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin

Command line arguments

File extension and language id
.rs=rust

Communication channel
* Command line (stdio)

Source folders
<Path to a Rust project. It may require a Cargo.toml file>

Initialize options
{"cargo":{"buildScripts":{"enable":true,},},"procMacro":{"enable":true,}}

More information: https://rust-analyzer.github.io/manual. ... ver-binary
Post Reply