brotzeit / rustic

Rust development environment for Emacs
Apache License 2.0
727 stars 102 forks source link

disable flycheck #75

Closed nikomatsakis closed 4 years ago

nikomatsakis commented 4 years ago

I didn't see an obvious way to configure rustic to disable flycheck -- is there a way to do that? (If so, perhaps it should be documented.) I've noticed that editing is fairly laggy and I (perhaps incorrectly) attribute this to flycheck.

brotzeit commented 4 years ago

Yeah I have to remove flycheck finally. I wanted to wait until I have something that also works with rust-analyzer, in case somebody is actually using the flycheck related code in rustic(that's actually mostly the code from flycheck-rust. I will remove it completely the next days and replace it with updated code if I have something that works.

For anybody who is curious, or even better motivated to help me =) -> https://github.com/emacs-lsp/lsp-mode/pull/1179 lsp-mode currently isn't working with rust-analyzer and flycheck(it is for rls).

nikomatsakis commented 4 years ago

@brotzeit any tips how I could remove flycheck in the meantime as a workaround?

brotzeit commented 4 years ago

Oh, sorry. This should work:

(require 'rustic)
(remove-hook 'rustic-mode-hook 'flycheck-mode)

I just noticed that I forgot to turn off flymake in my config. Maybe you also have flymake activated ? I don't know if flycheck is the reason for the lags you are experiencing, but it's also possible that it is related to some other package(s).

nikomatsakis commented 4 years ago

I'm not even sure what flymake is :)

nikomatsakis commented 4 years ago

but it does seem to be enabled, or at least it appears in the mode line

nikomatsakis commented 4 years ago

@brotzeit how do I remove flymake mode?

brotzeit commented 4 years ago

You can't, it's a builtin mode.

nikomatsakis commented 4 years ago

@brotzeit ok but there must be some way to make it stop executing? I added (flymake-mode 0) into my rustic hook, but that doesn't seem to do the trick. I can't quite figure out why it is even starting in the first place.

nikomatsakis commented 4 years ago

Ah, I think eglot is starting it.

brotzeit commented 4 years ago

Yeah, I think this was turned on because eglot works better with flymake(the author of eglot is also the maintainer of flymake). You can disable flymake this way (add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1))) (https://github.com/joaotavora/eglot/issues/123#issuecomment-444104870) I will document it in rustic.

jgarte commented 1 year ago

Is it possible to use rustic with the built-in flymake and eglot instead of flycheck?

brotzeit commented 1 year ago

Last time I checked it still worked https://github.com/brotzeit/rustic#client but wouldn't be the first time that stuff suddenly stops working. But in this case I assume there would already be some complaints.

jgarte commented 1 year ago

See this thread about what I experienced trying to use rustic-mode with eglot and flymake-mode turned on: https://github.com/rust-lang/rust-mode/issues/484#issuecomment-1372525271

Let me know if you'd like to see my emacs config. I can share it here with what I have configured. I just have to push my latest dots to my git repo today:

https://git.sr.ht/~whereiseveryone/confetti