Emacs で LSP を使ってるときにちょっと Language Server 側にパッチを当てたかった。
その際、git clone した Language Server (solargraph) に eglot を繋げるのに少し躓いたので自分用メモ。
接続手順
1. solargraph の起動
以下をターミナルで実行
$ git clone git@github.com:castwide/solargraph.git
$ cd solargraph
$ bundle exec solargraph socket --port "YOUR_PORT"
これで solargraph がローカルで立ち上がる。
確認はターミナルで top
コマンド等を実行すればOK。
(See: solargraph/using the solargraph executable)
2. eglot の起動
以下を Emacs で実行
(univarsal-argument
は、後に続くコマンドに argument を追加できるコマンド)
M-x univarsal-argument RET
M-x eglot RET
minibuffer 上で接続するプログラムを聞かれるので localhost:"YOUR_PORT"
と入力
これで eglot が solargraph に接続しにいく。
(See: eglot/conncting to a server)
動作確認

Mode Line 上に eglot
の文字列が現れれば接続成功!
おつかれさまでした。