aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-11-03 19:48:12 +0800
committerGitHub <noreply@github.com>2024-11-03 19:48:12 +0800
commitbc6ada4b0892b7f10852c0b8ca7209fd39a6d754 (patch)
tree6c7c8908e0885507d4f3072c7f30aec830bbf017
parentfix: correct type annotation on lspconfig.Config::on_new_config (#3411) (diff)
downloadnvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar.gz
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar.bz2
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar.lz
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar.xz
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.tar.zst
nvim-lspconfig-bc6ada4b0892b7f10852c0b8ca7209fd39a6d754.zip
fix(health): improve format of root dir and doc in checkhealth (#3416)
-rw-r--r--lua/lspconfig/health.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/lua/lspconfig/health.lua b/lua/lspconfig/health.lua
index d92e7c0c..5f40b1ac 100644
--- a/lua/lspconfig/health.lua
+++ b/lua/lspconfig/health.lua
@@ -85,7 +85,7 @@ end
--- Prettify a path for presentation.
local function fmtpath(p)
- if vim.startswith(p, 'Running') then
+ if vim.startswith(p, 'Running') or vim.startswith(p, 'Not') then
return p
end
local isdir = 0 ~= vim.fn.isdirectory(vim.fn.expand(p))
@@ -298,10 +298,10 @@ end
local function check_lspdocs(buf_clients, other_matching_configs)
health.start('Docs for active configs:')
- local lines = {}
- local function append_lines(config)
+ local function fmt_doc(config)
+ local lines = {}
if not config then
- return
+ return lines
end
local desc = vim.tbl_get(config, 'config_def', 'docs', 'description')
if desc then
@@ -310,18 +310,17 @@ local function check_lspdocs(buf_clients, other_matching_configs)
vim.list_extend(lines, vim.split(desc, '\n'))
lines[#lines + 1] = ''
end
+ return lines
end
for _, client in ipairs(buf_clients) do
local config = require('lspconfig.configs')[client.name]
- append_lines(config)
+ health.info(table.concat(fmt_doc(config), '\n'))
end
for _, config in ipairs(other_matching_configs) do
- append_lines(config)
+ health.info(table.concat(fmt_doc(config), '\n'))
end
-
- health.info(table.concat(lines, '\n'))
end
function M.check()