Questions tagged [rust-language-server]

The Rust Language Server (RLS) provides useful functionalities to IDEs, editors and other tools for Rust development, including code completion, 'goto definition', symbol search and reformatting.

The Rust Language Server (RLS) provides a server that runs in the background, providing IDEs, editors, and other tools with information about Rust programs. It supports functionality such as 'goto definition', symbol search, reformatting, and code completion, and enables renaming and refactorings.

RLS can be easily installed using rustup (setup page here), by adding the rls, rust-analysis, and rust-src toolchains:

rustup component add rls --toolchain nightly
rustup component add rust-analysis --toolchain nightly
rustup component add rust-src --toolchain nightly

RLS integration with Visual Studio Code is currently available with the Rust extension or the reference implementation.

14 questions
72
votes
5 answers

How to launch a Rust application from Visual Studio Code?

I have installed the Visual Studio Code extensions for Rust: I want to run my project and I don't understand where to click. I tried clicking Run Task, Run build task, Configure Default build task, but nothing reasonable happens.
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
11
votes
1 answer

Installing latest rust nightly complains about missing rls component

Trying to compile: https://github.com/SergioBenitez/Rocket/tree/master/examples/hello Cargo.toml [dependencies] rocket = "0.4.10" Complains that I need rust nightly $ cargo build ... Error: Rocket (core) requires a more recent version of rustc. …
Chuck
  • 431
  • 4
  • 10
11
votes
6 answers

Couldn't start client Rust Language Server

I'm trying to figure out how to use rustc & cargo from my WSL. I use VS Code and Rust (rls) plugin and can compile my code but there is a problem with RLS: Couldn't start client Rust Language Server Rustup not available. Install from…
9
votes
2 answers

How to avoid "E0463: can't find crate for `test` can't find crate" when building for thumbv7m-none-eabi?

RLS is giving the following error message when working on a project with an ARM target: E0463: can't find crate for test can't find crate Reproduction: cargo new --bin app cd app mkdir .cargo echo '[build]' > .cargo/config echo 'target =…
puritii
  • 1,069
  • 1
  • 7
  • 18
8
votes
2 answers

"duplicated RLS configuration" each time RLS is started inside VSCode

I upgraded my Rust environment via rustup update recently, then my VSCode reports an error each time I open my editor. Two repeated windows pop up at the bottom right corner of the editor, showing that Duplicated RLS configuration:…
Fei
  • 1,450
  • 1
  • 17
  • 30
4
votes
1 answer

Change nightly Rust version?

I tried to build rls by the command cargo +nightly build --release -Z unstable-options, but got the following errors: error[E0599]: no method named `expect_none` found for enum `Option` in the current scope -->…
Jw C
  • 171
  • 2
  • 6
4
votes
2 answers

Eclipse RLS Configuration file missing?

I have installed Eclipse for Rust and would like to use it for development. However, the content assist by RLS (such as code completion and highlighting) doesn’t work. RLS can't seem to find racer or rustc. As I was looking at the settings for Rust…
dragonFire
  • 98
  • 1
  • 9
2
votes
2 answers

Eclipse W10 Rust configuration "RLS"

I've installed Rust on the system. I've installed the Corrosion plugin in Eclipse (v.2021-03 - 4.19.0). I can open rs files and they show syntax highlighting. But I'm getting this annoying thing when I try to do any rusting: "Rust support not…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
2
votes
1 answer

How do I configure the Rust Language Server via LanguageClient-neovim?

I am attempting to use the Rust Language Server via LanguageClient-neovim and I want to set RLS options such as wait_to_build. I do not wish to configure LanguageClient-neovim settings like how to start the RLS process. The RLS only explains…
taryn
  • 581
  • 8
  • 18
1
vote
0 answers

VSCode underline hides wavy line

Underlines which signify Types and Namespaces obscure wavy underlines which signify errors and warnings. This makes it difficult for me to find the location of errors and warnings visually. Has anyone else encountered this problem? Any…
1
vote
2 answers

Full Rust setup in VSCode/Atom Issue

This is a long post, sorry. I have been trying to start a project, using Rust, but ran into a problem: it just does not work correctly on Linux in VSCode/Atom. Wasted 3 days, searching online, trying different tutorials/videos - nothing worked +…
rebelCoder
  • 71
  • 2
  • 9
1
vote
0 answers

Why does the Rust Language Server not warn about expected &str, found struct std::string::String?

The following code raises an error in all channels. The Rust Language Server does not detect this error and says the types are correct. What did I get wrong? use std::fs::File; use std::io::Read; use std::io::Write; use std::env; use…
person
  • 11
  • 4
0
votes
1 answer

Configure Rust Analyzer to disable Inlay Hints when used in Eclipse IDE with Corrosion

I'm using the latest Eclipse IDE (2023-03) with Corrosion, and the Rust Analyzer (1.69.0). But the inlay hints clutter up the code a lot, while these hints provide no new information. I would very much like to turn off inlay hints…
Code4R7
  • 2,600
  • 1
  • 19
  • 42
0
votes
1 answer

VS Code: run RLS on all .rs files

I have a Cargo package that I have opened as a workspace in Visual Studio Code. This way, the source code in .rs files in type checked through the Rust Language Server. But it only catches the files which are dependencies of main.rs where the main…
Thorkil Værge
  • 2,727
  • 5
  • 32
  • 48