From bbe75ba8c590747e7df7664128afdf96aeb539e2 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 7 Dec 2024 20:38:11 -0500 Subject: Better handling of LSP errors --- ide-usages.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ide-usages.c') 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)) { -- cgit v1.2.3