From cce7832075da4f06c2dfa18cc0325dae3a55c6b5 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 13 Oct 2023 13:40:45 +0200 Subject: [PATCH] Parse JSON false as :json-false instead of nil 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 https://github.com/emacs-lsp/lsp-mode/issues/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. --- lsp-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 01da57662b..2960f275f8 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -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 @@ -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 @@ -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)))