Closed k-bx closed 2 years ago
Hey, I'm afraid rust-mode doesn't provide this as a feature. So you can either additionally use a package from this list https://github.com/rust-lang/rust-mode#other-recommended-packages or look for a way to add additional parameters before running compile
(requires a little elisp knowledge). Sorry that I don't implement it, but I don't want to add similar code in two places(I'm maintaining a package of the list I mentioned).
However I would gladly merge this feature. This would ideally be located at rust-compile.el.
Another option would be to run compile
with C-u
and then use recompile
. But you can't configure the parameters as default...
Gotcha. Just for clarity: would you be willing to expose an option that extends extra args in customize-group
menu as PR?
Sorry but I'm not sure how this would look like. You mean add an additional defcustom
that holds the additional arguments ?
I've never done that, so not fully sure how to do that in elisp, but in haskell-mode for example you can say M-x customize-group haskell-compile
and you will see something like this where you can override the stack build command from standard to whatever you want, adding any arguments you want.
I think this is only meant for the user side. I never used customize.
I just checked the keybinding C-c C-d
and I couldn't find it in rust-mode. Can you tell me which command you are actually using. You probably use rust-check
?
Yes, it's rust-check
, I bind it myself
I added an option https://github.com/rust-lang/rust-mode/commit/832980d96a3b7e985bc8bfb1dc2bd7e9599c6312, try to use (setq rust-cargo-default-arguments "--tests")
in your config.
@brotzeit it worked, customized via customize-group
GUI. thank you!
Hi. I'm using
C-c C-d
to runcargo check
in a buffer. I'd love to extend the command to also check tests. What's the best way to do that atm? Thank you!