From dac8b7b6f4fec0136a3dc95afae0aa8aa8ce9fd9 Mon Sep 17 00:00:00 2001 From: Oliver Frank Date: Fri, 15 May 2020 16:42:24 -0400 Subject: [PATCH 1/2] Improve jsonrpc error reporting --- modules/jsonrpc/jsonrpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/jsonrpc/jsonrpc.cpp b/modules/jsonrpc/jsonrpc.cpp index 014b65e3e25..2dce9a286ee 100644 --- a/modules/jsonrpc/jsonrpc.cpp +++ b/modules/jsonrpc/jsonrpc.cpp @@ -120,7 +120,7 @@ Variant JSONRPC::process_action(const Variant &p_action, bool p_process_arr_elem } if (object == NULL || !object->has_method(method)) { - ret = make_response_error(JSONRPC::METHOD_NOT_FOUND, "Method not found", id); + ret = make_response_error(JSONRPC::METHOD_NOT_FOUND, "Method not found: " + method, id); } else { Variant call_ret = object->callv(method, args); if (id.get_type() != Variant::NIL) { From 2173d041af711c111d60d1fc1f45f96f4f8c7271 Mon Sep 17 00:00:00 2001 From: Oliver Frank Date: Fri, 15 May 2020 16:43:48 -0400 Subject: [PATCH 2/2] Fix incorrect capabilities notification in LSP --- modules/gdscript/language_server/lsp.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gdscript/language_server/lsp.hpp b/modules/gdscript/language_server/lsp.hpp index a2dcc488207..c0bea81b702 100644 --- a/modules/gdscript/language_server/lsp.hpp +++ b/modules/gdscript/language_server/lsp.hpp @@ -486,7 +486,7 @@ struct TextDocumentSyncOptions { * If present save notifications are sent to the server. If omitted the notification should not be * sent. */ - SaveOptions save; + bool save = false; Dictionary to_json() { Dictionary dict; @@ -494,7 +494,7 @@ struct TextDocumentSyncOptions { dict["willSave"] = willSave; dict["openClose"] = openClose; dict["change"] = change; - dict["save"] = save.to_json(); + dict["save"] = save; return dict; } }; @@ -1642,7 +1642,7 @@ struct ServerCapabilities { _FORCE_INLINE_ Dictionary to_json() { Dictionary dict; - dict["textDocumentSync"] = (int)textDocumentSync.change; + dict["textDocumentSync"] = textDocumentSync.to_json(); dict["completionProvider"] = completionProvider.to_json(); signatureHelpProvider.triggerCharacters.push_back(","); signatureHelpProvider.triggerCharacters.push_back("(");