Rust LSP Configuration

The details below describe how to install and configure the Rust rls Language Server found here.
NOTE: This installation process assumes Rust has been installed on the machine.

Installing the Language Server

To install the language server run the following command:
rustup component add rls-preview rust-analysis rust-src
With the software installed test the installation by running rls.exe --help at the command line prompt, which should result in the following output:
    --version or -V to print the version and commit info
    --help or -h for this message
    --cli starts the RLS in command line mode
    No input starts the RLS as a language server
If that output is not produced refer to the Rust language server page for more details.

Configuration

Start Zeus and use the Options, Document Types menu to edit the Rust document type and in the Language Server panel apply the following configuration settings:
Program Type: Executable
     Program: rls.exe
   Directory: $wdd
NOTE: In this case the directory of the executable can be omitted only because the Language Server executable folder is found in a folder that is located in the system PATH environment variable.

Using the Language Server

To test the configuration you will need to create a Rust project and a Zeus workspace as described below.
1: At the command line create a new Rust project as follow:
cd c:\Rust\
cargo new hello_world --bin
More details about Rust projects can be found here.
2: Start Zeus and use the Workspace, New menu to create a new, dynamic style workspace in that c:\Rust\hello_world folder.
3: Open the the hello_world\src\main.rs file found in the workspace and type in the code shown below to see the auto-complete and code navigation in action:
lsp rust


Latest Version: Zeus 3.99b
Released: 29th January 2024