From 9c0a9b4fdcb2f0912b8ec3b9f7127d660565f898 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 2 Jan 2023 14:42:17 +0100 Subject: fix initialized notification parameters LSP defines the parameters of the initialized notifications as empty object. The dart language server expects that the initialize notification has an empty params object. Therefore, pass an empty parameter table to the initialized notification. Tested with our fallback json implementation as well as dkjson. Fixes !37. --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index b0339aa..d0fcae8 100644 --- a/init.lua +++ b/init.lua @@ -863,7 +863,10 @@ local function ls_handle_method_response(ls, method_response, req) elseif method == 'initialize' then ls.initialized = true ls.capabilities = result.capabilities - ls_send_notification(ls, 'initialized') + params = {} + setmetatable(params, {__jsontype = 'object'}) + + ls_send_notification(ls, 'initialized', params) elseif method == 'textDocument/completion' then lspc_handle_completion_method_response(win, result, req.ctx) -- cgit v1.2.3