0

I work on several open source and commercial ruby projects, all of which have different sets of development tools installed. Some of them have solargraph available, some do not. Of those, some have sorbet available, others do not.

Right now, I have configured solargraph as a primary lsp for ruby-mode, and sorbet as an addon:

(after! lsp-mode
  (setq lsp-solargraph-use-bundler t)
  (setq lsp-sorbet-as-add-on t)
  (setq lsp-sorbet-use-bundler t))

(it's probably obvious from the config that I'm using Doom emacs, but I'm hoping for a generic solution here)

When entering a ruby project that has neither solargraph nor sorbet installed, that's easy; I can blocklist it and have done. However, when entering a project that has solargraph but not sorbet, I have to deal with an interactive prompt on every file I open: "Server sorbet-ls:66636/starting exited with status exit(check corresponding stderr buffer for details). Do you want to restart it? (y or n)".

So... how can I selectively disable one addon language server in projects that have not installed the necessary capabilities?

Chris R
  • 200
  • 2
  • 6

0 Answers0