Skip to content

Commit 26b56ac

Browse files
authored
feat: register library fn for ruby-lsp server (#4548)
- taken custom variable from lsp-solargraph - add ~/.asdf to the default value
1 parent ebb6609 commit 26b56ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clients/lsp-ruby-lsp.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
:safe #'booleanp
3939
:group 'lsp-ruby-lsp)
4040

41+
(defcustom lsp-ruby-lsp-library-directories
42+
'("~/.rbenv/" "/usr/lib/ruby/" "~/.rvm/" "~/.gem/" "~/.asdf")
43+
"List of directories which will be considered to be libraries."
44+
:type '(repeat string)
45+
:group 'lsp-ruby-lsp
46+
:package-version '(lsp-mode . "9.0.1"))
47+
4148
(defun lsp-ruby-lsp--build-command ()
4249
(append
4350
(if lsp-ruby-lsp-use-bundler '("bundle" "exec"))
@@ -68,6 +75,7 @@
6875
(make-lsp-client
6976
:new-connection (lsp-stdio-connection #'lsp-ruby-lsp--build-command)
7077
:activation-fn (lsp-activate-on "ruby")
78+
:library-folders-fn (lambda (_workspace) lsp-ruby-lsp-library-directories)
7179
:priority -2
7280
:action-handlers (ht ("rubyLsp.openFile" #'lsp-ruby-lsp--open-file)
7381
("rubyLsp.runTest" #'lsp-ruby-lsp--run-test)

0 commit comments

Comments
 (0)