From 16fbe87451b0ca3e8fa35fd04e0afbfab368ea65 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 9 Sep 2023 21:19:26 -0400 Subject: fix handling of TextEdit[] i hate microsoft so much --- lsp.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lsp.h') diff --git a/lsp.h b/lsp.h index 832d3d4..395f5ee 100644 --- a/lsp.h +++ b/lsp.h @@ -482,7 +482,14 @@ typedef struct { } LSPResponseWorkspaceSymbols; typedef enum { - LSP_CHANGE_EDIT = 1, + // yes, we do need to store multiple edits in a single workspace change; + // doing a workspace change with TextEdit[] t1 + // followed by a workspace change with TextEdit[] t2 + // is different from a workspace change with t1+t2 + // (see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textEditArray, + // https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentEdit) + // because microsoft is a bunch of idiots + LSP_CHANGE_EDITS = 1, LSP_CHANGE_CREATE, LSP_CHANGE_RENAME, LSP_CHANGE_DELETE @@ -490,7 +497,7 @@ typedef enum { typedef struct { LSPDocumentID document; - LSPTextEdit edit; + LSPTextEdit *edits; } LSPWorkspaceChangeEdit; typedef struct { @@ -859,7 +866,7 @@ void lsp_write_quit(void); /// print server-to-client communication #define LSP_SHOW_S2C 0 /// print client-to-server communication -#define LSP_SHOW_C2S 0 +#define LSP_SHOW_C2S 1 #endif // LSP_INTERNAL -- cgit v1.2.3