summaryrefslogtreecommitdiff
path: root/lsp.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-09 21:19:26 -0400
committerpommicket <pommicket@gmail.com>2023-09-09 21:19:26 -0400
commit16fbe87451b0ca3e8fa35fd04e0afbfab368ea65 (patch)
treedcd4c1e37b4a89173e23047f644df94a9ca92399 /lsp.h
parent0dcfd5a4f1fd865c24c01b17b214e1f72e4c06fe (diff)
fix handling of TextEdit[]
i hate microsoft so much
Diffstat (limited to 'lsp.h')
-rw-r--r--lsp.h13
1 files changed, 10 insertions, 3 deletions
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