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-definitions.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ide-definitions.c') diff --git a/ide-definitions.c b/ide-definitions.c index 79677e8..8b895db 100644 --- a/ide-definitions.c +++ b/ide-definitions.c @@ -156,6 +156,13 @@ void definitions_process_lsp_response(Ted *ted, LSP *lsp, const LSPResponse *res } defs->last_request.id = 0; + if (lsp_response_is_error(response)) { + if (menu_is_open(ted, MENU_GOTO_DEFINITION)) { + menu_close(ted); + } + ted_flash_error_cursor(ted); + return; + } switch (response->request.type) { case LSP_REQUEST_DEFINITION: -- cgit v1.2.3