Skip to content

Commit

Permalink
Parse JSON false as :json-false instead of nil
Browse files Browse the repository at this point in the history
This would break code actions where the server sends us an action
containing a `false` boolean parameter. `lsp-mode` would translate this
into `nil`, and then send a `null` back to the language server. An
example of this causing problems was
emacs-lsp#4184.

There may be parts of `lsp-mode` that expect `false` values to be parsed
as `nil`, so any logic involving parsed booleans may need to be updated.
  • Loading branch information
robbert-vdh committed Oct 13, 2023
1 parent 9c3ebe4 commit cce7832
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6740,7 +6740,7 @@ server. WORKSPACE is the active workspace."
'plist
'hash-table)
:null-object nil
:false-object nil)
:false-object :json-false)
`(let ((json-array-type 'vector)
(json-object-type (if lsp-use-plists
'plist
Expand All @@ -6757,7 +6757,7 @@ server. WORKSPACE is the active workspace."
'plist
'hash-table)
:null-object nil
:false-object nil)
:false-object :json-false)
`(let ((json-array-type 'vector)
(json-object-type (if lsp-use-plists
'plist
Expand Down Expand Up @@ -8626,7 +8626,7 @@ When ALL is t, erase all log buffers of the running session."
(done (lsp--handle-process-exit workspace ""))))))
:object-type object-type
:null-object nil
:false-object nil))
:false-object :json-false))
"*json-rpc-connection*"))
(cons con con)))

Expand Down

0 comments on commit cce7832

Please sign in to comment.