diff options
author | Peter Lithammer <peter.lithammer@gmail.com> | 2024-12-18 15:31:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 06:31:25 -0800 |
commit | 07d5dc8938a7f5d8cf2b702ef4f26af926b6ac45 (patch) | |
tree | 723e3e11c11b822124255f7702bc0a46d7047b45 /runtime/lua/vim/lsp/health.lua | |
parent | f9eb68f340f9c0dbf3b6b2da3ddbab2d5be21b61 (diff) | |
download | rneovim-07d5dc8938a7f5d8cf2b702ef4f26af926b6ac45.tar.gz rneovim-07d5dc8938a7f5d8cf2b702ef4f26af926b6ac45.tar.bz2 rneovim-07d5dc8938a7f5d8cf2b702ef4f26af926b6ac45.zip |
feat(lsp): show server version in `:checkhealth` #31611
Problem:
Language server version information missing from `:checkhealth vim.lsp`.
Solution:
Store `InitializeResult.serverInfo.version` from the `initialize`
response and display for each client in `:checkhealth vim.lsp`.
Diffstat (limited to 'runtime/lua/vim/lsp/health.lua')
-rw-r--r-- | runtime/lua/vim/lsp/health.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua index d2cf888d89..d94bc70a65 100644 --- a/runtime/lua/vim/lsp/health.lua +++ b/runtime/lua/vim/lsp/health.lua @@ -40,6 +40,8 @@ local function check_active_clients() local clients = vim.lsp.get_clients() if next(clients) then for _, client in pairs(clients) do + local server_version = vim.tbl_get(client, 'server_info', 'version') + or '? (no serverInfo.version response)' local cmd ---@type string local ccmd = client.config.cmd if type(ccmd) == 'table' then @@ -62,6 +64,7 @@ local function check_active_clients() end report_info(table.concat({ string.format('%s (id: %d)', client.name, client.id), + string.format('- Version: %s', server_version), dirs_info, string.format('- Command: %s', cmd), string.format('- Settings: %s', vim.inspect(client.settings, { newline = '\n ' })), |