diff options
author | pommicket <pommicket@gmail.com> | 2022-12-30 15:27:38 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-30 15:27:38 -0500 |
commit | d51f4ce90fc40bb6b1813e7716d1db40cf91ee15 (patch) | |
tree | dbd72d0add72d4923244e93e476deeb422b0ff99 /lsp-parse.c | |
parent | 547bfbba7a1ef84d397711882a501fc4914addba (diff) |
cancelling requests
Diffstat (limited to 'lsp-parse.c')
-rw-r--r-- | lsp-parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lsp-parse.c b/lsp-parse.c index f720d12..a816ec9 100644 --- a/lsp-parse.c +++ b/lsp-parse.c @@ -694,6 +694,7 @@ static void process_message(LSP *lsp, JSON *json) { } } + double error_code = json_force_number(json_get(json, "error.code")); JSONValue error = json_get(json, "error.message"); JSONValue result = json_get(json, "result"); if (result.type != JSON_UNDEFINED || error.type == JSON_STRING) { @@ -708,7 +709,7 @@ static void process_message(LSP *lsp, JSON *json) { response.error = json_string_get_alloc(json, error.val.string); } - if (response.error) { + if (response.error && error_code != LSP_ERROR_REQUEST_CANCELLED) { add_to_messages = true; } else switch (response_to.type) { case LSP_REQUEST_COMPLETION: |