mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(lsp): list all workspace folders in healthcheck #30966
This commit is contained in:
parent
ff29fd8c6e
commit
0086ee90dd
@ -39,12 +39,27 @@ local function check_active_clients()
|
|||||||
elseif type(client.config.cmd) == 'function' then
|
elseif type(client.config.cmd) == 'function' then
|
||||||
cmd = tostring(client.config.cmd)
|
cmd = tostring(client.config.cmd)
|
||||||
end
|
end
|
||||||
|
local dirs_info ---@type string
|
||||||
|
if client.workspace_folders and #client.workspace_folders > 1 then
|
||||||
|
dirs_info = string.format(
|
||||||
|
' Workspace folders:\n %s',
|
||||||
|
vim
|
||||||
|
.iter(client.workspace_folders)
|
||||||
|
---@param folder lsp.WorkspaceFolder
|
||||||
|
:map(function(folder)
|
||||||
|
return folder.name
|
||||||
|
end)
|
||||||
|
:join('\n ')
|
||||||
|
)
|
||||||
|
else
|
||||||
|
dirs_info = string.format(
|
||||||
|
' Root directory: %s',
|
||||||
|
client.root_dir and vim.fn.fnamemodify(client.root_dir, ':~')
|
||||||
|
) or nil
|
||||||
|
end
|
||||||
report_info(table.concat({
|
report_info(table.concat({
|
||||||
string.format('%s (id: %d)', client.name, client.id),
|
string.format('%s (id: %d)', client.name, client.id),
|
||||||
string.format(
|
dirs_info,
|
||||||
' Root directory: %s',
|
|
||||||
client.root_dir and vim.fn.fnamemodify(client.root_dir, ':~') or nil
|
|
||||||
),
|
|
||||||
string.format(' Command: %s', cmd),
|
string.format(' Command: %s', cmd),
|
||||||
string.format(' Settings: %s', vim.inspect(client.settings, { newline = '\n ' })),
|
string.format(' Settings: %s', vim.inspect(client.settings, { newline = '\n ' })),
|
||||||
string.format(
|
string.format(
|
||||||
|
Loading…
Reference in New Issue
Block a user