Questions tagged [rust-analyzer]

100 questions
0
votes
1 answer

Disable cargo-related functionality in rust-analyzer

If I don't want to use cargo for some reasons, I have the error: could not find 'Cargo.toml'. Is there any way to disable all Cargo.toml-related functionality? I tried this: { "cargo": { "noSysroot": true, "sysroot": "", …
fingolfin
  • 591
  • 9
0
votes
0 answers

Stepping through #[proc_macro] code with a debugger

I am having trouble debugging a rust #[proc_macro] using traditional debugger tooling. I have found resources online, some can be found here, which suggests either expanding the macro and debugging the output or writing error messages/printlns. I'm…
0
votes
1 answer

rust-analyzer inlay hints mostly works, but I get the elipsis (...) for types of variables. How do I get the full type for variable declarations?

I'm just a beginner to Rust, but got rustup, cargo, rustc etc all working and VSCode set up. Even breakpoints work. For function parameters I sometimes get the proper type hints, but for variable declarations I only see ... I wonder why I see no…
user2943111
  • 421
  • 1
  • 5
  • 15
0
votes
0 answers

VSCode Code Actions not working with Rust

I'm using VSCode with rust-analyzer. I can get the Code Actions menu to show up, but clicking on the items does nothing. How can I fix this? Everything else works fine. It's only the Code Actions that aren't doing anything. I've already tried…
user81198
  • 21
  • 2
0
votes
1 answer

How to determine the rust-analyzer version used by VSCode?

How can I find out which version of rust-analyzer is used by the extension with the same name in VSCode?
bluenote10
  • 23,414
  • 14
  • 122
  • 178
0
votes
3 answers

Rust Analyzer doesn't create warning for undefined variables

For some reason Rust Analyzer isn't generating a warning for undefined variables. Do I need to tweak some settings somewhere? I'm also not getting warnings for unused variables, unimported crates, etc. Edit: Tested this out with a new workspace.…
reeslabree
  • 127
  • 13
0
votes
1 answer

Emacs: rust-analyzer + rustic - couldn't discover workspace

I am an a-bit-futher-than-newbie Arch Linux user... I have been working with this setup (emacs + rustic + rust-analyzer + lsp-ui et cetera with settings like in here https://robert.kra.hn/posts/rust-emacs-setup/) for a month now. Yesterday I tried…
George
  • 75
  • 7
0
votes
1 answer

Rust-Analyzer VSCode-Plugin with Tauri

When working on a Tauri project in VSCode, I get the following error message from the rust-analyzer plugin. rust-analyzer failed to discover workspace I know that the cause of the problem is that I loaded the Tauri project as my workspace in VSCode…
0
votes
0 answers

What's the best way to send requests to a rust-analyzer instance programmatically?

I am working on a proc macro, and would like to be able to write some tests to ensure it's playing nice with rust-analyzer (e.g. correct localized diagnostics). Ideally, my testing suite would look something like this: Start rust-analyzer pointed…
sak
  • 2,612
  • 24
  • 55
0
votes
0 answers

VSC has Rust-analyzer extension Bootstrap error

I'm on Windows using Visual studio code and running a WSL2 on debian. My project is then on WSL and I've installed local WSL extension in VSC. When installing rust analyzer, it forces its way to WSL:debian (I guess this is normal) but I get the…
Juce
  • 1
  • 1
0
votes
0 answers

How to add vendored crates to project workspace?

in my rust project, i run cargo vendor and vendored all dependencies in vendor folder. The .cargo/config.toml file is updated to point to vendor/ folder. [source.vendored-sources] directory = "vendor" Some of the vendored crates i have patched, so…
weima
  • 4,653
  • 6
  • 34
  • 55
0
votes
1 answer

How to enable autocomplete for type annotations for Rust variables in VS Code using rust-analyzer?

When working with Rust in VS Code, there's an add-on/extension called rust-analyzer that you can install via the Marketplace. I remember watching a tutorial on Rust (don't have the link) and the person teaching had this feature where he'd type…
Malekai
  • 4,765
  • 5
  • 25
  • 60
0
votes
0 answers

VS Code custom color theme identifies, but does not render selected token color

I am using TextMate rules to try and write a custom VSC Rust color theme that's not quite as busy as the default one, following this explanation in the docs. For a token without semantic information, the VSC scope inspector correctly reports the…
aas
  • 177
  • 8
0
votes
1 answer

How to make the `CocInlayHints` background color transparent in `.vimrc`

This is a follow up question to Change the color of the type hint in coc.nvim's rust-analyzer I'm wondering if it's possible to change the background color of inlay hints from Rust Analyzer in Vim. Adding a hex #ffffff00 doesn't seem to work, nor…
0
votes
1 answer

Not an editor command CocInstall coc-rust-analyzer

Ok, so i installed coc.nvim with neobundle, by adding to my .vimrc NeoBundle 'neoclide/coc.nvim' after this i added :CocInstall coc-rust-analyzer to the same file as it mentioned in the guide. But even after I'm sure that CocInstall command is…
nojitsi
  • 351
  • 3
  • 13