aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/health.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /runtime/lua/vim/lsp/health.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/lua/vim/lsp/health.lua')
-rw-r--r--runtime/lua/vim/lsp/health.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index 987707e661..fe06006108 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.health.report_info
- local report_warn = vim.health.report_warn
+ local report_info = vim.health.info
+ local report_warn = vim.health.warn
local log = require('vim.lsp.log')
local current_log_level = log.get_level()
@@ -22,18 +22,25 @@ function M.check()
local log_path = vim.lsp.get_log_path()
report_info(string.format('Log path: %s', log_path))
- local log_file = vim.loop.fs_stat(log_path)
+ local log_file = vim.uv.fs_stat(log_path)
local log_size = log_file and log_file.size or 0
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')
+ local clients = vim.lsp.get_clients()
+ vim.health.start('vim.lsp: Active Clients')
if next(clients) then
for _, client in pairs(clients) do
+ local attached_to = table.concat(vim.tbl_keys(client.attached_buffers or {}), ',')
report_info(
- string.format('%s (id=%s, root_dir=%s)', client.name, client.id, client.config.root_dir)
+ string.format(
+ '%s (id=%s, root_dir=%s, attached_to=[%s])',
+ client.name,
+ client.id,
+ vim.fn.fnamemodify(client.config.root_dir, ':~'),
+ attached_to
+ )
)
end
else