summaryrefslogtreecommitdiff
path: root/ide-usages.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2024-12-07 20:38:11 -0500
committerpommicket <pommicket@gmail.com>2024-12-07 20:38:11 -0500
commitbbe75ba8c590747e7df7664128afdf96aeb539e2 (patch)
tree40342f0fda4dbfcc02030a25dfe78d973170ab9a /ide-usages.c
parentb74905fcb282603f8afc45cd3f08fa8c28c83d41 (diff)
Better handling of LSP errors
Diffstat (limited to 'ide-usages.c')
-rw-r--r--ide-usages.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ide-usages.c b/ide-usages.c
index 9ae31e4..b94eb45 100644
--- a/ide-usages.c
+++ b/ide-usages.c
@@ -44,6 +44,11 @@ void usages_process_lsp_response(Ted *ted, const LSPResponse *response) {
return; // not for us
if (response->request.id != usages->last_request.id)
return;
+ if (lsp_response_is_error(response)) {
+ usages->last_request.id = 0;
+ ted_flash_error_cursor(ted);
+ return;
+ }
LSP *lsp = ted_get_lsp_by_id(ted, usages->last_request.lsp);
const LSPResponseReferences *refs = &response->data.references;
if (lsp && arr_len(refs->locations)) {