Questions tagged [rust]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
304 views

eglot + rust-analyzer: Failed to discover workspace

I've been having a really great experience w/ eglot for C++ development. I'm finding it a lot easier to use than lsp-mode (at least for C++). However, I'm running into an issue w/ both eglot (and lsp-...
Matt Messersmith's user avatar
0 votes
1 answer
139 views

lsp-mode + rust_analyzer: How to add workspace directory automatically without requiring .git directories next to the Cargo.toml file?

I've set up lsp mode with rust using https://robert.kra.hn/posts/rust-emacs-setup/ mostly successfully. I can create a new hello-world directory inside /tmp just fine. Opening up main.rs inside that ...
bgoodr's user avatar
  • 339
0 votes
1 answer
32 views

Rustic - auto-complete gives intermediate dollar-values - not sure where to start loking

Rustic (I think) keeps giving me what appears to be not-yet-filled-in completion. When I type e.g. env::va I get suggestions that include var(...), as expected, but when I hit return I end up with env:...
John Graham's user avatar
0 votes
0 answers
238 views

Problems with eglot and rust-analyzer

I've been trying to switch to eglot as my LSP client in Emacs but today I've found an issue I can't figure out how to solve. I'm getting a lot of diagnostic errors from rust-analyzer about proc ...
yorodm's user avatar
  • 111
0 votes
2 answers
132 views

Adjust unreadable blue color for rustic mode

When using clippy with rustic mode, I'm unable to read any of the blue messages on my screen. I would like to change the color so I can read these messages. Existing answers tell me to adjust the ...
DeinFreund's user avatar
0 votes
1 answer
222 views

Configuration issues when using rust-analyzer from counsel-tramp

I have local MacOS(intel) machine running with emacs 27.2 and remote ubuntu 20.0 server for my personal Rust project development with rust-analyzer for lsp. When I ssh remotely and start emacs on the ...
user76333's user avatar
  • 113
0 votes
0 answers
77 views

Terminal layout is broken when I turn on lsp

I use lsp-mode when I write code for Rust, C++ with this init.el settings: (use-package lsp-mode ;; reformat code and add missing (or remove old) imports :hook ((rust-mode c++-mode) . lsp) :bind ...
user76333's user avatar
  • 113
1 vote
0 answers
218 views

Scrolling through rust-lsp suggestions is very slow. How to go about debugging this?

I'm trying to set up Emacs with rust-lsp ( following this guide). The suggestions from the rust-analyzer are being picked up as you can see in the screenshot. But when I attempt to scroll through them ...
rtviii's user avatar
  • 113
1 vote
1 answer
224 views

How to specify lsp configuration messages in emacs?

I'm trying to configure rust analyzer to expand proc macros. According to it's documentation I have to configure my editor (i.e. emacs) to send this JSON as a LSP message: { "cargo": { ...
zvavybir's user avatar
  • 113
0 votes
1 answer
246 views

lsp-rust-analyzer ignores edition value in Cargo.toml

When talking about Emacs configuration, the rust-analyzer manual mentions [...] this excellent guide from @rksm. Which I followed to good effect, in particular: (use-package lsp-mode :commands ...
Chen Levy's user avatar
  • 385
4 votes
1 answer
1k views

lsp-mode: disable documentation popup

I installed rustic-mode with LSP server. They work. But now it shows docs and description of every symbol I put my cursor on. It distracts and irritates me a lot. How can I make it show the symbol ...
user4035's user avatar
  • 1,059
0 votes
1 answer
646 views

my rust analyzer don't work on emacs 27

I recently installed the latest version of emacs and Rust-analyzer, and downloaded the lsp-mode package as well, but when I activate the rust-analyzer with the "lsp" command it simply ...
user31659's user avatar
2 votes
1 answer
316 views

How to focus or change point on child frame

I am trying to use lsp-ui package to display some documentation for Rust. When I put the cursor on a type for example, a popup child frame is created but the focus is still on the main window. If I ...
Mihai's user avatar
  • 143
1 vote
1 answer
80 views

Is there a way to generally search package or language documentation within emacs?

In this case, I'm most interested in Rust's documentation, which lives at doc.rust-lang.org/std. eww is incompatible with JS, so the documentation doesn't play nice, thus my general current soln is to ...
cryptograthor's user avatar
2 votes
1 answer
449 views

rust-analyzer completion broken

When I try to use auto-completion with lsp + rust-analyzer, all functions inserted like that: shared_state.clone_from(${1:source})$0 I cannot find any way to disable this "arguments". I don'...
Flowneee's user avatar
  • 237
1 vote
1 answer
1k views

Attempting to use org-babel to write “literate” Rust

I'm playing around with writing Rust snippets in my editor. I can get org mode to format my things nicely and play nicely with rust-mode. But I can't evaluate my code snippets. I think that may be ...
cryptograthor's user avatar
2 votes
1 answer
878 views

company doesn't pop up completion list automatically

I'm trying to get company mode to automatically trigger the pop-up with a list of possible completion. Unless I'm doing this wrong this is not the default behaviour? Current I have to run M-x company-...
knarf's user avatar
  • 313
4 votes
2 answers
848 views

Cargo-process does not accept user input

Using the Emacs mode for Cargo, I'm able to build and run Rust code inside Emacs. However, the terminal that opens when executing cargo-process-run does not accept user input. For example, when ...
Safron's user avatar
  • 171
2 votes
1 answer
619 views

highlight-regexp groups for syntax highlighting

I want to highlight certain words to a color using highlight-regexp. The words I want to highlight are "fn", "let", "mut", etc. for rust development. The code I have so far is this: (add-hook '...
Vent's user avatar
  • 77
1 vote
1 answer
759 views

Async shell command can't find command

I have installed the Rust programming language (Debian). Now i can compile and run programs from terminal (with the cargo build and cargo run commands), but not from inside emacs. The cargo compiler ...
user avatar
1 vote
1 answer
222 views

about setting up rust-playground

I have a problem with setting up rust-playground on Emacs. I installed rust-playground on Emacs 25.0.93 of Macbook Pro. When I run rust-playground, the following error happens. rustc /Users/...
Hiroki's user avatar
  • 41
1 vote
0 answers
340 views

Rust autocomplete - hide paths where stuff is found

When the autocomplete from company-racer kicks in, it shows the path where it is found for some reason. For example, if I start typing: use std::i it comes up with io /usr/src/rust/src/libstd/io/mod....
unskilledidiot's user avatar
3 votes
2 answers
2k views

Integrate rust-clippy into Emacs Rust development

rust-clippy is a linter for Rust. Is there an existing package or idiom that integrates it into an Emacs Rust workflow, the way emacs-racer integrates racer?
Matthew Piziak's user avatar
6 votes
1 answer
503 views

Display documentation in Company results

The GitHub page for emacs-racer shows function signatures in company completion results. My results display "Function" and nothing beyond. I've searched through customize-group company and can't ...
Matthew Piziak's user avatar
2 votes
1 answer
638 views

How can I setup the tab indentation size for ***-mode (Rust, Python, Ruby, etc)?

I have rust-mode installed on my Emacs 24.4. The tab indentation I have is 2 whitespaces, however in Rust mode it's different. I want to setup the tab indentation size for rust-mode, how can I do ...
Oskar K.'s user avatar
  • 278
2 votes
1 answer
2k views

Flycheck and Rust

I'm currently struggling to set up error checking for rust in emacs. Flycheck seems to work fine with other languages (C, Python, Ruby, eLisp) but doesn't appear to do anything in rust-mode. I ...
Jack Cargill's user avatar
2 votes
1 answer
1k views

Rust Racer autocomplete problem in Cygwin

I'm trying to set up racer mode for Rust language autocomletion, but when press 'tab' key got messages like this: Company: An error occurred in auto-begin Company: backend company-capf error "/...
DoSofRedRiver's user avatar
1 vote
1 answer
395 views

run a binary that uses ncurses in eshell under xterm-256color emulation

I have a binary (a rust program that uses bindings to ncurses) and I need to run it in eshell as xterm-256color (well, make it work correctly at least). I haven't figured out how to do this yet. Tried ...
Sum Proxy's user avatar
1 vote
2 answers
615 views

Add newline after a semicolon keypress

Only when rust-mode is enabled, what is the best way to insert a newline after a press on the ; key? This is what I have actually: (defun my-rust-lang-mode-config () (local-set-key (kbd ";") (...
Nsukami _'s user avatar
  • 6,371