mirror of
https://github.com/neovim/neovim.git
synced 2026-07-24 09:50:48 +00:00
fix(lsp): unclear error on malformed server responses #40422
Problem: Malformed server responses with `null` (vim.NIL) values, do not show clear error messages. Solution: Assert two known, specific cases, to avoid user confusion.
This commit is contained in:
@@ -211,6 +211,7 @@ function M.open(opts, ...)
|
||||
|
||||
--- @type lsp.DiagnosticRelatedInformation[]
|
||||
local related_info = vim.tbl_get(diagnostic, 'user_data', 'lsp', 'relatedInformation') or {}
|
||||
assert(related_info ~= vim.NIL, 'server response has invalid (null) relatedInformation')
|
||||
-- Below the diagnostic, show its LSP related information (if any) in the form of file name and
|
||||
-- range, plus description.
|
||||
for _, info in ipairs(related_info) do
|
||||
|
||||
Reference in New Issue
Block a user