mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
fix(lsp): decode 'null' in server responses as vim.NIL #34849
Problem: Previously, 'null' value in LSP responses were decoded as 'nil'. This caused ambiguity for fields typed as '? | null' and led to loss of explicit 'null' values, particularly in 'data' parameters. Solution: Decode all JSON 'null' values as 'vim.NIL' and adjust handling where needed. This better aligns with the LSP specification, where 'null' and absent fields are distinct, and 'null' should not be used to represent missing values. This also enables proper validation of response messages to ensure that exactly one of 'result' or 'error' is present, as required by the JSON-RPC specification.
This commit is contained in:
@@ -86,6 +86,7 @@ LSP
|
||||
arguments corresponding to a log entry instead of the individual arguments.
|
||||
• `vim.lsp.semantic_tokens.start/stop` now renamed to
|
||||
`vim.lsp.semantic_tokens.enable`
|
||||
• Missing fields in LSP messages are now represented using |vim.NIL| instead of nil.
|
||||
|
||||
LUA
|
||||
|
||||
|
Reference in New Issue
Block a user