From 1710649105aa4cfa5f932aa1a980ae087978f4a6 Mon Sep 17 00:00:00 2001 From: adjuvant Date: Sun, 20 Aug 2023 21:34:19 +0200 Subject: [PATCH] Fix textDocument/hover returning invalid message The `result` key must not be missing in the response. --- src/fennel-ls/message.fnl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fennel-ls/message.fnl b/src/fennel-ls/message.fnl index 32dd137..7471a56 100644 --- a/src/fennel-ls/message.fnl +++ b/src/fennel-ls/message.fnl @@ -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)