rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Run | Debug duplicates

Open ItsNilDev opened this issue 3 years ago • 7 comments

On emacs, When I try to write a test something like this:

#[test]
fn test_

Every time I press space a new Run Test | Debug appears next to it like this. I think the problem is with runnables.rs image I'm using rust-analyzer version: rust-analyzer 2021-10-18 Is there a way that i can disable this feature on emacs, if it's not fixable?

ItsNilDev avatar Oct 24 '21 17:10 ItsNilDev

Can't reproduce this in VSCode so this sounds like a bug in the client code you use for emacs.

Veykril avatar Oct 24 '21 19:10 Veykril

Have you tried it for emacs? I don't think there's any problem with my config for emacs

ItsNilDev avatar Oct 25 '21 10:10 ItsNilDev

I don't have an emacs set up so no. Fwiw you can disable runnable test lenses with the rust-analyzer.lens.run for the time being(rust-analyzer.lens.enable for all lenses in general).

Veykril avatar Oct 25 '21 12:10 Veykril

What do you mean? What's rust-analyzer.lens.run?

ItsNilDev avatar Oct 26 '21 15:10 ItsNilDev

rust-analyzer.lens.run is a configuration option. I don't know how to set them using whichever lsp extension you use for emacs however.

bjorn3 avatar Oct 26 '21 15:10 bjorn3

As bjorn said, its a config to disable the corresponding lenses. (I apologize for dropping that word by accident when I typed that 😅)

Veykril avatar Oct 26 '21 17:10 Veykril

I was trying to turn off the Debug/Run "lens" as it's too distracting, but couldn't find a way to turn off that in emacs (I think the option is not exposed in emacs, i.e. in lsp-rust.el).

The only way I've found to turn off this is by turning off lenses altogether, by adding the following to the emacs config file:

(setq lsp-lens-enable nil)

as documented in https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/

ahmedriza avatar Sep 05 '22 11:09 ahmedriza

Do you still encounter this problem?

Veykril avatar Feb 13 '23 15:02 Veykril