diff options
| author | Kim A. Brandt <kimabrandt@gmx.de> | 2026-07-12 18:52:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-12 12:52:10 -0400 |
| commit | 543a96e49179060999ebcb12372ce36ea6be646d (patch) | |
| tree | 82a9ca8c9b21c6eff2820c9e5da4e6c4ec05e7b1 /runtime/lua/vim/diagnostic/_float.lua | |
| parent | 58b6310adc938f49ea85e6ab4839616f8af28ecd (diff) | |
| download | rneovim-543a96e49179060999ebcb12372ce36ea6be646d.tar.gz rneovim-543a96e49179060999ebcb12372ce36ea6be646d.tar.bz2 rneovim-543a96e49179060999ebcb12372ce36ea6be646d.zip | |
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.
Diffstat (limited to 'runtime/lua/vim/diagnostic/_float.lua')
| -rw-r--r-- | runtime/lua/vim/diagnostic/_float.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/diagnostic/_float.lua b/runtime/lua/vim/diagnostic/_float.lua index 4cda1be61f..aa41cdd38e 100644 --- a/runtime/lua/vim/diagnostic/_float.lua +++ b/runtime/lua/vim/diagnostic/_float.lua @@ -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 |