mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor!(ruby): remove robe
BREAKING CHANGE: This removes the Robe package from the ruby module, which now relies on lsp-mode/eglot to provide those features with more consistency and less maintenance overhead. Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=69411568 Close: #8237 Fix: #6994 Fix: #3055
This commit is contained in:
@ -4,13 +4,9 @@
|
|||||||
#+since: 1.3
|
#+since: 1.3
|
||||||
|
|
||||||
* Description :unfold:
|
* Description :unfold:
|
||||||
This module add Ruby and optional Ruby on Rails support to Emacs.
|
This module add Ruby and optional Ruby on Rails support to Emacs. IDE features
|
||||||
|
(like code completion, jump-to-definition, etc) are provided by a supported LSP
|
||||||
- Code completion ([[doom-package:robe]])
|
client (recommended: [[https://github.com/Shopify/ruby-lsp][ruby-lsp]] or [[https://github.com/castwide/solargraph][solargraph]]).
|
||||||
- Syntax checking ([[doom-package:flycheck]])
|
|
||||||
- Jump-to-definitions ([[doom-package:robe]])
|
|
||||||
- Bundler
|
|
||||||
- Rubocop integration ([[doom-package:flycheck]])
|
|
||||||
|
|
||||||
** Maintainers
|
** Maintainers
|
||||||
- [[doom-user:][@hlissner]]
|
- [[doom-user:][@hlissner]]
|
||||||
@ -21,8 +17,8 @@ This module add Ruby and optional Ruby on Rails support to Emacs.
|
|||||||
- +chruby ::
|
- +chruby ::
|
||||||
Enable chruby integration.
|
Enable chruby integration.
|
||||||
- +lsp ::
|
- +lsp ::
|
||||||
Enable LSP support for ~ruby-mode~. Requires [[doom-module::tools lsp]] and a langserver
|
Enable LSP support for ~ruby-mode~. Requires [[doom-module::tools lsp]] and a
|
||||||
(supports solargraph).
|
langserver (recommended: [[https://github.com/Shopify/ruby-lsp][ruby-lsp]] or [[https://github.com/castwide/solargraph][solargraph]]).
|
||||||
- +rails ::
|
- +rails ::
|
||||||
Enable rails navigational commands, plus server+console integration.
|
Enable rails navigational commands, plus server+console integration.
|
||||||
- +rbenv ::
|
- +rbenv ::
|
||||||
@ -41,7 +37,6 @@ This module add Ruby and optional Ruby on Rails support to Emacs.
|
|||||||
- [[doom-package:minitest]]
|
- [[doom-package:minitest]]
|
||||||
- [[doom-package:rake]]
|
- [[doom-package:rake]]
|
||||||
- [[doom-package:rbenv]] if [[doom-module:+rbenv]]
|
- [[doom-package:rbenv]] if [[doom-module:+rbenv]]
|
||||||
- [[doom-package:robe]]
|
|
||||||
- [[doom-package:rspec-mode]]
|
- [[doom-package:rspec-mode]]
|
||||||
- [[doom-package:rubocop]]
|
- [[doom-package:rubocop]]
|
||||||
- [[doom-package:rvm]] if [[doom-module:+rvm]]
|
- [[doom-package:rvm]] if [[doom-module:+rvm]]
|
||||||
@ -71,7 +66,6 @@ These guides will help you install Ruby:
|
|||||||
Then run ~$ gem install rubocop~ to install rubocop.
|
Then run ~$ gem install rubocop~ to install rubocop.
|
||||||
|
|
||||||
** Formatter
|
** Formatter
|
||||||
|
|
||||||
Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]].
|
Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]].
|
||||||
|
|
||||||
* TODO Usage
|
* TODO Usage
|
||||||
@ -80,12 +74,6 @@ Formatting is handled using the [[doom-module::editor format]] module via [[http
|
|||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
** Commands
|
** Commands
|
||||||
*** robe
|
|
||||||
| command | key / ex command | description |
|
|
||||||
|----------------------+--------------------+--------------------------------------------------------------------|
|
|
||||||
| ~robe-start~ | [[kbd:][<localleader> ']] | Open ruby lang server for auto-completions and jump to definitions |
|
|
||||||
| ~robe-rails-refresh~ | [[kbd:][<localleader> R]] | Refresh the lang server. |
|
|
||||||
|
|
||||||
*** projectile-rails
|
*** projectile-rails
|
||||||
The projectile-rails prefix is [[kbd:][<localleader> r]]:
|
The projectile-rails prefix is [[kbd:][<localleader> r]]:
|
||||||
| command | key / ex command | description |
|
| command | key / ex command | description |
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
;;; lang/ruby/autoload.el -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +ruby-cleanup-robe-servers-h () ; TODO Use me
|
|
||||||
"Clean up dangling inf robe processes if there are no more `ruby-mode' buffers
|
|
||||||
open."
|
|
||||||
;; FIXME This should wait X seconds before cleaning up
|
|
||||||
(unless (or (not robe-mode) (doom-buffers-in-mode 'ruby-mode))
|
|
||||||
(let (inf-buffer kill-buffer-query-functions)
|
|
||||||
(while (setq inf-buffer (robe-inf-buffer))
|
|
||||||
(let ((process (get-buffer-process inf-buffer))
|
|
||||||
confirm-kill-processes)
|
|
||||||
(when (processp process)
|
|
||||||
(kill-process (get-buffer-process inf-buffer))
|
|
||||||
(kill-buffer inf-buffer)))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +ruby-robe-repl-handler ()
|
|
||||||
"Start Robe and open a REPL (for `set-repl-handler!')."
|
|
||||||
(robe-start)
|
|
||||||
(robe-inf-buffer))
|
|
@ -39,42 +39,6 @@
|
|||||||
"{" #'ruby-toggle-block))
|
"{" #'ruby-toggle-block))
|
||||||
|
|
||||||
|
|
||||||
(use-package! robe
|
|
||||||
:defer t
|
|
||||||
:init
|
|
||||||
(add-hook! 'ruby-mode-hook
|
|
||||||
(defun +ruby-init-robe-mode-maybe-h ()
|
|
||||||
"Start `robe-mode' if `lsp-mode' isn't active."
|
|
||||||
(or (bound-and-true-p lsp-mode)
|
|
||||||
(bound-and-true-p lsp--buffer-deferred)
|
|
||||||
(robe-mode +1))))
|
|
||||||
:config
|
|
||||||
(set-repl-handler! 'ruby-mode #'+ruby-robe-repl-handler)
|
|
||||||
(set-company-backend! 'ruby-mode 'company-robe 'company-dabbrev-code)
|
|
||||||
(set-lookup-handlers! 'ruby-mode
|
|
||||||
:definition #'robe-jump
|
|
||||||
:documentation #'robe-doc)
|
|
||||||
(when (boundp 'read-process-output-max)
|
|
||||||
;; Robe can over saturate IPC, making interacting with it slow/clobbering
|
|
||||||
;; the GC, so increase the amount of data Emacs reads from it at a time.
|
|
||||||
(setq-hook! '(robe-mode-hook inf-ruby-mode-hook)
|
|
||||||
read-process-output-max (* 1024 1024)))
|
|
||||||
(when (modulep! :editor evil)
|
|
||||||
(add-hook 'robe-mode-hook #'evil-normalize-keymaps))
|
|
||||||
(map! :localleader
|
|
||||||
:map robe-mode-map
|
|
||||||
"'" #'robe-start
|
|
||||||
"h" #'robe-doc
|
|
||||||
"R" #'robe-rails-refresh
|
|
||||||
:prefix "s"
|
|
||||||
"d" #'ruby-send-definition
|
|
||||||
"D" #'ruby-send-definition-and-go
|
|
||||||
"r" #'ruby-send-region
|
|
||||||
"R" #'ruby-send-region-and-go
|
|
||||||
"i" #'ruby-switch-to-inf))
|
|
||||||
|
|
||||||
|
|
||||||
;; NOTE Must be loaded before `robe-mode'
|
|
||||||
(use-package! yard-mode
|
(use-package! yard-mode
|
||||||
:hook ruby-mode)
|
:hook ruby-mode)
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
;; Programming environment
|
;; Programming environment
|
||||||
(package! rubocop :pin "f5fd18aa810c3d3269188cbbd731ddc09006f8f5")
|
(package! rubocop :pin "f5fd18aa810c3d3269188cbbd731ddc09006f8f5")
|
||||||
(package! robe :pin "ec4b7e74e93de3133924f3caca79bcea04fcc666")
|
|
||||||
|
|
||||||
;; Project tools
|
;; Project tools
|
||||||
(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7")
|
(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7")
|
||||||
|
Reference in New Issue
Block a user