Skip to content

Commit

Permalink
feat: register library fn for ruby-lsp server
Browse files Browse the repository at this point in the history
- taken custom variable from lsp-solargraph
- add ~/.asdf to the default value
  • Loading branch information
merrickluo committed Sep 17, 2024
1 parent 12befaa commit 7ec8ce5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clients/lsp-ruby-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
:safe #'booleanp
:group 'lsp-ruby-lsp)

(defcustom lsp-ruby-lsp-library-directories
'("~/.rbenv/" "/usr/lib/ruby/" "~/.rvm/" "~/.gem/" "~/.asdf")
"List of directories which will be considered to be libraries."
:type '(repeat string)
:group 'lsp-ruby-lsp
:package-version '(lsp-mode . "9.0.1"))

(defun lsp-ruby-lsp--build-command ()
(append
(if lsp-ruby-lsp-use-bundler '("bundle" "exec"))
Expand All @@ -47,6 +54,7 @@
(make-lsp-client
:new-connection (lsp-stdio-connection #'lsp-ruby-lsp--build-command)
:activation-fn (lsp-activate-on "ruby")
:library-folders-fn (lambda (_workspace) lsp-ruby-lsp-library-directories)
:priority -2
:server-id 'ruby-lsp-ls))

Expand Down

0 comments on commit 7ec8ce5

Please sign in to comment.