Fix textDocument/hover returning invalid message

The `result` key must not be missing in the response.
This commit is contained in:
adjuvant 2023-08-20 21:34:19 +02:00 committed by XeroOl
parent 7c1bbc8c2b
commit 1710649105

View File

@ -7,6 +7,12 @@ missing fields with null fields, and I want to have one location
to look to fix this in the future."
(local utils (require :fennel-ls.utils))
(local json (require :json.json))
(λ nullify [?value]
(case ?value
nil json.null
v v))
(local error-codes
{;; JSON-RPC errors
@ -50,7 +56,7 @@ to look to fix this in the future."
(λ create-response [id ?result]
{:jsonrpc "2.0"
: id
:result ?result})
:result (nullify ?result)})
(λ ast->range [self file ?ast]
(case (values (utils.get-ast-info ?ast :bytestart)