LspRouter
複数のLSPサーバーに処理を振り分けるルーター
Installation
gem install lsp_router
Usage
次のような config ファイルを作成して、lsp_router config-file
のように実行する。
logfile '/tmp/lsp_router'
loglevel :info
server :rubocop do
command 'rubocop --lsp'
mode :stdio
end
server :solargraph do
command 'solargraph stdio'
mode :stdio
end
この例では、rubocop --lsp
と solargraph stdio
を起動して、クライアントからの処理を振り分ける。
最初に各サーバーの capabilities を確認して、各サーバーにどの機能があるかを確認し、クライアントからの REQUEST は対応しているサーバーに渡す。複数のサーバーが同じ機能を持っていれば上に書いたサーバーが優先される。NOTIFICATION は全サーバーに渡す。
Example
Emacs の Eglot の場合はこんな感じに設定するといいっぽい。
(add-to-list 'eglot-server-programs '((ruby-mode ruby-ts-mode) . ("lsp_router" "--error=lsp_router.err" "lsp_router.conf")))
License
GPLv3