Fix textDocument/hover returning invalid message
The `result` key must not be missing in the response.
This commit is contained in:
parent
7c1bbc8c2b
commit
1710649105
@ -7,6 +7,12 @@ missing fields with null fields, and I want to have one location
|
|||||||
to look to fix this in the future."
|
to look to fix this in the future."
|
||||||
|
|
||||||
(local utils (require :fennel-ls.utils))
|
(local utils (require :fennel-ls.utils))
|
||||||
|
(local json (require :json.json))
|
||||||
|
|
||||||
|
(λ nullify [?value]
|
||||||
|
(case ?value
|
||||||
|
nil json.null
|
||||||
|
v v))
|
||||||
|
|
||||||
(local error-codes
|
(local error-codes
|
||||||
{;; JSON-RPC errors
|
{;; JSON-RPC errors
|
||||||
@ -50,7 +56,7 @@ to look to fix this in the future."
|
|||||||
(λ create-response [id ?result]
|
(λ create-response [id ?result]
|
||||||
{:jsonrpc "2.0"
|
{:jsonrpc "2.0"
|
||||||
: id
|
: id
|
||||||
:result ?result})
|
:result (nullify ?result)})
|
||||||
|
|
||||||
(λ ast->range [self file ?ast]
|
(λ ast->range [self file ?ast]
|
||||||
(case (values (utils.get-ast-info ?ast :bytestart)
|
(case (values (utils.get-ast-info ?ast :bytestart)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user