diff options
author | pommicket <pommicket@gmail.com> | 2024-12-07 20:38:11 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2024-12-07 20:38:11 -0500 |
commit | bbe75ba8c590747e7df7664128afdf96aeb539e2 (patch) | |
tree | 40342f0fda4dbfcc02030a25dfe78d973170ab9a /ide-document-link.c | |
parent | b74905fcb282603f8afc45cd3f08fa8c28c83d41 (diff) |
Better handling of LSP errors
Diffstat (limited to 'ide-document-link.c')
-rw-r--r-- | ide-document-link.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ide-document-link.c b/ide-document-link.c index 71307b5..754cecd 100644 --- a/ide-document-link.c +++ b/ide-document-link.c @@ -112,9 +112,11 @@ void document_link_process_lsp_response(Ted *ted, const LSPResponse *response) { if (response->request.type != LSP_REQUEST_DOCUMENT_LINK || response->request.id != dl->last_request.id) return; - if (!dl->last_request.id) - return; // request was cancelled - + dl->last_request.id = 0; + if (lsp_response_is_error(response)) { + document_link_clear(ted); + return; + } bool key_down = document_link_activation_key_down(ted); if (!key_down) return; |