fix(picker.lsp_config): nil on lsp info (#2459)

## Description

It will report message `error: vim/shared.lua:0: t: expected table, got
nil` when execute `Snacks.picker.lsp_config()`.
This commit is contained in:
EasonMo 2025-11-06 19:18:08 +08:00 committed by GitHub
parent c83ff8d598
commit c5257fa690
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -274,7 +274,7 @@ function M.preview(ctx)
lines[#lines + 1] = "- **buffers**: " .. list(vim.tbl_keys(client.attached_buffers))
-- server capabilities
local methods = vim.tbl_keys(vim.lsp.protocol._request_name_to_server_capability) --[[@as string[] ]]
local methods = vim.tbl_keys(vim.lsp.protocol._request_name_to_server_capability or {}) --[[@as string[] ]]
table.sort(methods)
if #methods > 0 then
lines[#lines + 1] = "- **server capabilities**:"