-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move indent level to rust-common #538
base: master
Are you sure you want to change the base?
Conversation
Emacs complains that `rust-indent-offset` isn't set and a few minor modes (e.g. formatting, smartparens) stop working. This moves that variable to the common file so the treesitter mode has the variable set.
@@ -16,5 +16,11 @@ | |||
:type 'function | |||
:group 'rust-mode) | |||
|
|||
(defcustom rust-indent-offset 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of moving it here, do you think a defvaralias should be instead created. Something similar to this: https://github.com/psibi/rustic/blob/4dac7f34c30d91e3ecb2602fff7e81b6efdc75d7/rustic.el#L52
Also lsp-mode for some reason complains about "void-variable rust-indent-offset":
lsp-mode has such code: (rust-mode . rust-indent-offset) ; Rust
(rust-ts-mode . rust-ts-mode-indent-offset) but for some reason it try to access |
@Dushistov Does this PR fix that for you ? |
It fixes, but for reason introduce new bug: lsp-mode for files except So for |
That strange and looks to be a different bug since lsp-mode detection is not done in rust-mode AFAIK. If you can address this comment: #538 (comment) I think we can merge a new PR. |
Emacs complains that
rust-indent-offset
isn't set and a few minor modes (e.g.
formatting, smartparens) stop working.
This moves that variable to the common
file so the treesitter mode has the
variable set.
I'm not sure why more of the rust-prog-mode variables aren't in the rust-common file so I left them there. But, this was the only variable that was causing breakage for me. There is a rust-ts-mode-indent-offset variable too (which is also 4 by default) - should rust-mode override that variable with this one, override the rust-mode variable with the tree sitter one when the tree sitter mode is on, or keep them independent?