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-format.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ide-format.c') diff --git a/ide-format.c b/ide-format.c index 8cc0059..6cb6e8a 100644 --- a/ide-format.c +++ b/ide-format.c @@ -53,6 +53,11 @@ void format_process_lsp_response(Ted *ted, const LSPResponse *response) { || request->type == LSP_REQUEST_FORMATTING)) { return; } + formatting->last_request_id.id = 0; + if (lsp_response_is_error(response)) { + ted_flash_error_cursor(ted); + return; + } TextBuffer *buffer = ted->active_buffer; if (!buffer) return; if (buffer_lsp_document_id(buffer) != request->data.formatting.document) -- cgit v1.2.3