GitHub - dense-analysis/ale: Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support - dense-analysis/ale
https://github.com/w0rp/ale
vimのlspクライアント。
vim-lsp
vim-lsp解読
plugin/lsp.vim
autoload/lsp.vim
autoload/lsp/client.vim
autoload/async/job.vim
ファイル一個だけだった。
vim
と nvim
の違いをラップしているぽい。
vim
の job_start
と nvim
の jobstart
。
なるほど。
vim-lspの動きを追う(dls)
dls だと
ServerCapabilities
に
definitionProvider
が入ってないな・・・
Requestにそもそも入っていないのでは
入れてみた。
実際に通信するようになた。
エラーが Definition not found
に変わって
確かに、 result
の中身が空っぽなので not found
とサーバーが応答している。
問題が vim-lsp
から dls
に移った。
ale
LanguageClient
一部が rust
で実装されているぽい。
vim-lsp
built-in
まだ、実装中?
Language Server Protocol
version 3.x
language-server-protocol/versions/protocol-2-x.md at main · microsoft/language-server-protocol
Defines a common protocol for language servers. Contribute to microsoft/language-server-protocol development by creating an account on GitHub.
https://github.com/Microsoft/language-server-protocol/blob/master/versions/protocol-2-x.md
通信シーケンス
<-- request1 initialize
--> response1
<-- notify initialized
<-- notify textDocument/didOpen
<-- notify textDocument/didChange
--> notify textDocument/publishDiagnostics
<-- request2 textDocument/documentHighlight
--> response2
log viewer
-
https://github.com/Microsoft/language-server-protocol-inspector
-
VSCodeでlsp を実行させて通信ログを出力
-
通信ログを見やすく表示
しかし、どうやってログを作るかよくわからん。
vim-lsp
のログを改造して作ってみる。
各言語のサーバー
試してみたやつ。
python
pyls
Linux, Windows 共に動いた。
dlang
serve-d
うまくいかなかったので、調べている・・・
dls
うまくいかなかったので、調べている・・・
c++
Linuxで動いた。