Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JSON false values incorrectly being encoded as nulls in code actions #183

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lsp-haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,13 @@ These are assembled from the customizable variables `lsp-haskell-server-path'
and `lsp-haskell-server-args' and `lsp-haskell-server-wrapper-function'."
(funcall lsp-haskell-server-wrapper-function (append (list lsp-haskell-server-path "--lsp") lsp-haskell-server-args) ))

(defun lsp-haskell--action-filter (command)
"lsp-mode transforms JSON false values in code action
arguments to JSON null values when sending the requests back to
the server. We need to explicitly tell it which code action
arguments are non-nullable booleans."
(lsp-fix-code-action-booleans command '(:restrictToOriginatingFile :withSig)))

;; This mapping is set for 'haskell-mode -> haskell' in the lsp-mode repo itself. If we move
;; it there, then delete it from here.
;; It also isn't *too* important: it only sets the language ID, see
Expand Down Expand Up @@ -511,6 +518,7 @@ and `lsp-haskell-server-args' and `lsp-haskell-server-wrapper-function'."
;; we should set something consistent here.
:language-id "haskell"
:completion-in-comments? lsp-haskell-completion-in-comments
:action-filter #'lsp-haskell--action-filter
))

;; ---------------------------------------------------------------------
Expand Down
Loading