Skip to content

Commit 049be2c

Browse files
committed
Fix false values being encoded as null in actions
1 parent 2808b06 commit 049be2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lsp-haskell.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,13 @@ These are assembled from the customizable variables `lsp-haskell-server-path'
484484
and `lsp-haskell-server-args' and `lsp-haskell-server-wrapper-function'."
485485
(funcall lsp-haskell-server-wrapper-function (append (list lsp-haskell-server-path "--lsp") lsp-haskell-server-args) ))
486486

487+
(defun lsp-haskell--action-filter (command)
488+
"lsp-mode transforms JSON false values in code action
489+
arguments to JSON null values when sending the requests back to
490+
the server. We need to explicitly tell it which code action
491+
arguments are non-nullable booleans."
492+
(lsp-fix-code-action-booleans command '(:restrictToOriginatingFile :withSig)))
493+
487494
;; This mapping is set for 'haskell-mode -> haskell' in the lsp-mode repo itself. If we move
488495
;; it there, then delete it from here.
489496
;; It also isn't *too* important: it only sets the language ID, see
@@ -511,6 +518,7 @@ and `lsp-haskell-server-args' and `lsp-haskell-server-wrapper-function'."
511518
;; we should set something consistent here.
512519
:language-id "haskell"
513520
:completion-in-comments? lsp-haskell-completion-in-comments
521+
:action-filter #'lsp-haskell--action-filter
514522
))
515523

516524
;; ---------------------------------------------------------------------

0 commit comments

Comments
 (0)