Questions tagged [rust-analyzer]
100 questions
0
votes
1 answer
rust-analyzer doesn't show errors and suggestions neovim
I have updated my arch setup and compiled neovim 0.9.1 on just installed Debian 12.
rust-analyzer doesn't show any messages and doesn't give any autocomplete suggestions.
rust-analyzer is installed by mason, by rustup component add and by npm…

bruh
- 47
- 1
- 6
0
votes
1 answer
Inlay hints and hover information not working in VSCode
I'm learning Rust and I'm using VSCode on Linux. I have this project:
.
├── src
│ ├── 01_hello_world
│ │ ├── comm.rs
│ │ └── mod.rs
│ └── main.rs
├── target
├── Cargo.lock
└── Cargo.toml
Inlay hints and hover information work fine on…

Ουιλιαμ Αρκευα
- 5,561
- 7
- 35
- 61
0
votes
0 answers
The "Better Comments" extension does not work with rust-analyzer
I use several extensions in my Visual Studio Code. Two of them are "Better Comments" and "rust-analyzer". The problem is that only in files with the .rs extension, the "Better Comments" extension does not color the comments. I turned off…

VenoX
- 11
- 2
0
votes
0 answers
In Rust, what does it mean for a type hint to show `{unknown}`?
When using the sha2 crate, importing its Digest trait allows the use of new to create a new hasher,
use sha2::{Digest, Sha256};
fn main() {
let hasher = Sha256::new();
}
However, there are no type hints or autocompletion for new. Specifically…

aryzing
- 4,982
- 7
- 39
- 42
0
votes
0 answers
Sublime Text - How to remove Code Lens for Rust Analyzer?
I’m using Sublime Text with the LSP and LSP Rust Analyzer packages. I would like to disable Rust Analyzer’s Code Lens. I’ve already done this in settings:
// Settings in here override those in…

Thicc Theo
- 65
- 5
0
votes
1 answer
stop company-complete-selection from eating following word in rust code?
Say I have a piece of code like foo.bar(), but I realize I need to change it to foo.unwrap().bar(). If I first move to the position after the dot, and start typing unwrap, I'll reach a state like foo.unw^bar() (where ^ denotes my cursor position).…

ajp
- 1,723
- 14
- 22
0
votes
1 answer
Proc macro "main" not expanded + Rust-analyzer not spawning server
I join these two questions in one, as they maybe are related. A few days ago, I started having this error in the [#actix_rt::main] line, before the main function:
proc macro `main` not expanded: cannot find proc-macro server in sysroot…

Zerok
- 1,323
- 1
- 24
- 56
0
votes
2 answers
Vscode Rust Analyzer Syntax Highlighting Punctuation not working
I'm trying to change the syntax highlighting for punctuation in rust within vscode, but it doesnt seem to work for semicolons, colons, angle-brackets and brackets.
I noticed that even setting "*": "#660066" doesnt highlight those punctuations.
Could…

brain-sturm
- 45
- 4
0
votes
1 answer
vscode does not work when it has multiple cargo projects?
I'm learning to use rust,i am using vscode。
I have two cargo projects in my workspace,Why rust-analyzer only has an error message in the first project, but not in the second。
Is there any setting required?

Itsme
- 76
- 5
0
votes
0 answers
How can I chage the rule in Rust VS Code that set the char ">" in red color the char is alone?
For some reason VS Code started highligting the caracter > in the arrow in functions -> with the color red
I try something like this in the settings.json file:
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope":…

01speed1
- 1
- 1
0
votes
1 answer
The terminal process failed to launch: Path to shell executable "/path/on/project/cargo" does not exist
My remote server environment is Windows.
After installing rust-analyzer in Visual Studio Code, I tried to use the plugin to generate Run test commands in the code.
However, I encountered an error similar to the following:
Executing task:…

linonon
- 3
- 3
0
votes
0 answers
Change default brace placement with auto-complete with Rust-Analyzer
Using the Rust-Analyzer and VS code, auto-complete snippets use default rust formatting, i.e fn gets replaced with
fn () {
}
However, I have never liked this brace style, nor do I plan on sharing my code, and for my own work I want to be able to…

MooseTech
- 1
- 1
0
votes
1 answer
lsp-rust has slow code action and syntax highlight
I use spacemacs with rust layer (lsp-rust-analyzer backend). When I made syntax error, the error highlight appears after a small delay. Then I correct it, the old code action and error highlight sometimes still there, event when no error at current…

michael-nhat
- 1
- 1
- 2
0
votes
2 answers
VS Code error `failed to run build scripts` when using Rust-Analyzer only on one specific project
My company just switched on a new repo the Rust project I'm working on, to merge it with a Tauri project, and VS Code now gave me this error:
Failed to run build scripts
I can compile, run my project or use cargo check to see the warnings/error but…

Noe Baiocchi
- 1
- 1
0
votes
0 answers
Rust VSCode Docs of private lib not available
I've got a private lib stored on GitHub I'm using on my project.
For some reason the docs for this lib are not loaded in VSCode, so they are not displayed when hovering over the documented method.
In my Cargo.toml the lib is added like…

Dominic Meyer
- 31
- 5