fix(lsp): handle nil root_dir in health check (#29010)

fix(lsp): handle nil root_dir in health check (#29007)

The root directory could show up as something like:

    Root directory: ~/path/to/cwd/v:null

Despite being `nil`

(cherry picked from commit f03b1622ad)

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-05-25 17:30:27 -05:00
committed by GitHub
parent 84d7bfcf16
commit 4efca7cda5
3 changed files with 6 additions and 4 deletions

View File

@@ -41,7 +41,10 @@ local function check_active_clients()
end
report_info(table.concat({
string.format('%s (id: %d)', client.name, client.id),
string.format(' Root directory: %s', vim.fn.fnamemodify(client.root_dir, ':~')),
string.format(
' Root directory: %s',
client.root_dir and vim.fn.fnamemodify(client.root_dir, ':~') or nil
),
string.format(' Command: %s', cmd),
string.format(' Settings: %s', vim.inspect(client.settings, { newline = '\n ' })),
string.format(