mirror of
https://github.com/neovim/neovim.git
synced 2026-07-20 16:11:58 +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:
@@ -83,6 +83,7 @@ end
|
||||
--- @return table?
|
||||
local function tags_lsp_to_vim(diagnostic, client_id)
|
||||
local tags ---@type table?
|
||||
assert(diagnostic.tags ~= vim.NIL, 'server response has invalid (null) tags')
|
||||
for _, tag in ipairs(diagnostic.tags or {}) do
|
||||
if tag == protocol.DiagnosticTag.Unnecessary then
|
||||
tags = tags or {}
|
||||
|
||||
Reference in New Issue
Block a user