aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/health.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-14 23:13:48 -0700
committerJosh Rahm <joshuarahm@gmail.com>2023-01-14 23:13:48 -0700
commit7a6e249a32f79331bfb5e29bc0cabcf89a026081 (patch)
tree27a7354ec18448e4090ac91581534baa7b537254 /runtime/lua/vim/lsp/health.lua
parent442d4e54c30b8e193e3f6e4d32b43e96815bccd7 (diff)
parent6134c1e8a39a5e61d0593613343a5923a86e3545 (diff)
downloadrneovim-7a6e249a32f79331bfb5e29bc0cabcf89a026081.tar.gz
rneovim-7a6e249a32f79331bfb5e29bc0cabcf89a026081.tar.bz2
rneovim-7a6e249a32f79331bfb5e29bc0cabcf89a026081.zip
Merge remote-tracking branch 'upstream/master' into usermarks
Diffstat (limited to 'runtime/lua/vim/lsp/health.lua')
-rw-r--r--runtime/lua/vim/lsp/health.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index ba730e3d6d..987707e661 100644
--- a/runtime/lua/vim/lsp/health.lua
+++ b/runtime/lua/vim/lsp/health.lua
@@ -2,8 +2,8 @@ local M = {}
--- Performs a healthcheck for LSP
function M.check()
- local report_info = vim.fn['health#report_info']
- local report_warn = vim.fn['health#report_warn']
+ local report_info = vim.health.report_info
+ local report_warn = vim.health.report_warn
local log = require('vim.lsp.log')
local current_log_level = log.get_level()
@@ -27,6 +27,18 @@ function M.check()
local report_fn = (log_size / 1000000 > 100 and report_warn or report_info)
report_fn(string.format('Log size: %d KB', log_size / 1000))
+
+ local clients = vim.lsp.get_active_clients()
+ vim.health.report_start('vim.lsp: Active Clients')
+ if next(clients) then
+ for _, client in pairs(clients) do
+ report_info(
+ string.format('%s (id=%s, root_dir=%s)', client.name, client.id, client.config.root_dir)
+ )
+ end
+ else
+ report_info('No active clients')
+ end
end
return M