From 1eaef3694d54d3d92f0b43304c72f5148b4e5db9 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 27 Dec 2022 18:01:48 -0500 Subject: send "params": {} for initialized request it's unclear whether the standard requires this, but gopls fails without it --- lsp-write.c | 5 ++++- main.c | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lsp-write.c b/lsp-write.c index 5f6c858..ffa5337 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -342,11 +342,14 @@ static void write_request(LSP *lsp, LSPRequest *request) { case LSP_REQUEST_WORKSPACE_FOLDERS: assert(0); break; - case LSP_REQUEST_INITIALIZED: case LSP_REQUEST_SHUTDOWN: case LSP_REQUEST_EXIT: // no params break; + case LSP_REQUEST_INITIALIZED: + write_key_obj_start(o, "params"); + write_obj_end(o); + break; case LSP_REQUEST_INITIALIZE: { write_key_obj_start(o, "params"); write_key_number(o, "processId", process_get_id()); diff --git a/main.c b/main.c index 5a80b04..e10d6c3 100644 --- a/main.c +++ b/main.c @@ -13,7 +13,6 @@ - what to do if initialize request takes a long time? - delete old sent requests? but make sure requests that just take a long time are okay. (if the server never sends a response) -- what's wrong with gopls? - TESTING: make rust-analyzer-slow (waits 10s before sending response) - run everything through valgrind ideally with leak checking - grep -i -n TODO *.[ch] -- cgit v1.2.3