Skip to content

Commit

Permalink
fix(language/ruby): switch back to ruby-lsp after fixing indent-regio…
Browse files Browse the repository at this point in the history
…n issue
  • Loading branch information
jimehk committed Dec 17, 2024
1 parent 384f7fc commit 45c41b3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions modules/languages/siren-ruby.el
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@
(use-package lsp-solargraph
:straight lsp-mode

:hook
(ruby-mode . siren-lsp-solargraph-ruby-mode-setup)
(ruby-ts-mode . siren-lsp-solargraph-ruby-mode-setup)
;; Disable solargraph in favor of ruby-lsp.
;; :hook
;; (ruby-mode . siren-lsp-solargraph-ruby-mode-setup)
;; (ruby-ts-mode . siren-lsp-solargraph-ruby-mode-setup)

:custom
(lsp-solargraph-multi-root nil)
Expand Down Expand Up @@ -241,11 +242,9 @@ and will break things."
(use-package lsp-ruby-lsp
:straight lsp-mode

;; TODO: Figure out why ruby-lsp breaks `indent-region', then try switching to
;; it again in favor of solargraph.
;; :hook
;; (ruby-mode . siren-lsp-ruby-lsp-mode-setup)
;; (ruby-ts-mode . siren-lsp-ruby-lsp-mode-setup)
:hook
(ruby-mode . siren-lsp-ruby-lsp-mode-setup)
(ruby-ts-mode . siren-lsp-ruby-lsp-mode-setup)

:preface
(defun siren-lsp-ruby-lsp-format-on-save-p ()
Expand Down Expand Up @@ -274,6 +273,10 @@ output typically does not conform to any common Ruby formatting standards."
;; out grey color for the first 1-2 seconds as you type.
(setq-local lsp-semantic-tokens-enable nil)

;; Disable range formatting via ruby-lsp, as it simply breaks
;; `indent-region', causing it to do nothing.
(setq-local lsp-enable-indentation nil)

;; Enable format on save if the predicate returns true.
(when (siren-lsp-ruby-lsp-format-on-save-p)
(lsp-format-buffer-on-save-mode t))
Expand Down

0 comments on commit 45c41b3

Please sign in to comment.