mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(lang): control Ruby formatting method on a per-project basis
Allow individual projects to override the default lsp-mode based formatting method by setting rubocopfmt-on-save-use-lsp-format-buffer as a dir-local variable. This is useful for projects which require older versions of Ruby where the latest Solargraph version is not supported, and formatting is better handled by rubocop directly.
This commit is contained in:
@@ -97,7 +97,6 @@
|
||||
'(lsp-solargraph-use-bundler . t))
|
||||
|
||||
(defun siren-lsp-ruby-mode-setup ()
|
||||
(lsp-format-buffer-on-save-mode t)
|
||||
(lsp-deferred)))
|
||||
|
||||
(use-package rufo
|
||||
@@ -163,6 +162,9 @@
|
||||
("C-c . D" . rubocop-autocorrect-directory)))
|
||||
|
||||
(use-package rubocopfmt
|
||||
:hook
|
||||
(ruby-mode . rubocopfmt-mode)
|
||||
|
||||
:bind (:map ruby-mode-map
|
||||
("C-c C-f" . rubocopfmt))
|
||||
|
||||
@@ -170,6 +172,7 @@
|
||||
(rubocopfmt-include-unsafe-cops t)
|
||||
(rubocopfmt-show-errors 'echo)
|
||||
(rubocopfmt-use-bundler-when-possible t)
|
||||
(rubocopfmt-on-save-use-lsp-format-buffer t)
|
||||
|
||||
:init
|
||||
(add-to-list 'safe-local-variable-values
|
||||
|
||||
Reference in New Issue
Block a user