Questions tagged [rust]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
324 views

Command not found: cargo

I'm getting started with using Emacs as a basic IDE for which I have rust-mode installed. I can execute cargo test from the Terminal, but when I try this in Emacs with: M-x compile cargo test I get ...
Saurabh's user avatar
  • 213
0 votes
1 answer
30 views

How to get rid of `> run | debug` clickable text?

I want to get rid of the arrow and the run/debug clickable option (I'm fine with my shortcuts, I never use the mouse and it just gets in the way) but I've no idea what it's called and googling various ...
John Graham's user avatar
0 votes
1 answer
379 views

How to set rust-analyzer.linkedProjects with eglot?

My project structure is like this: -- Project Root - .git - rusttools - Cargo.toml - src - main.rs When I open main.rs in Emacs, eglot complains: [eglot] Server reports (type=1): ...
Lai Yu-Hsuan's user avatar
1 vote
1 answer
123 views

How to open external rust documentation (rust-analyzer.openDocs) from Emacs?

According to the changelog, Rust-Analyzer has a command openDocs since 2020. It should open the documentation for the symbol under the cursor. How could I call this from emacs? I'm using eglot and ...
Lai Yu-Hsuan's user avatar
0 votes
0 answers
50 views

How can I continuously check semantic error with rust-analyser instead of upon saving only?

I'm using eglot with flymake and rust-analyzer. However, it seems to only check errors when I save the file: d() is a non-existing function. It doesn't show any error, until I save the file: Ideally ...
Lai Yu-Hsuan's user avatar
2 votes
0 answers
637 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
394 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
  • 341
0 votes
1 answer
44 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
1 vote
2 answers
179 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
288 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
89 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
269 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
268 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
325 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
1 vote
1 answer
768 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
408 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
94 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
464 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
  • 247
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
3 votes
1 answer
1k 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
  • 323
4 votes
2 answers
968 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
691 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
809 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
229 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
345 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
516 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
715 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
412 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
637 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,521