summaryrefslogtreecommitdiff
path: root/lsp.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-23 12:17:34 -0500
committerpommicket <pommicket@gmail.com>2022-12-23 12:17:34 -0500
commitbc21923ba75a46693f6470f9bff903e0df46ac15 (patch)
tree0f6ab5a910142861773591ea3845d700119e21c5 /lsp.h
parente8ebc051bd606df22622c012d68804e275ef1dd5 (diff)
LSP document_data
Diffstat (limited to 'lsp.h')
-rw-r--r--lsp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/lsp.h b/lsp.h
index 72e621e..cee1505 100644
--- a/lsp.h
+++ b/lsp.h
@@ -7,7 +7,7 @@
// (if the server never sends a response)
// - TESTING: make rust-analyzer-slow (waits 10s before sending response)
-typedef u32 DocumentID;
+typedef u32 LSPDocumentID;
typedef enum {
LSP_REQUEST,
@@ -49,13 +49,13 @@ typedef enum {
typedef struct {
Language language;
- DocumentID document;
+ LSPDocumentID document;
// freed by lsp_request_free
char *file_contents;
} LSPRequestDidOpen;
typedef struct {
- DocumentID document;
+ LSPDocumentID document;
} LSPRequestDidClose;
// see TextDocumentContentChangeEvent in the LSP spec
@@ -66,7 +66,7 @@ typedef struct {
} LSPDocumentChangeEvent;
typedef struct {
- DocumentID document;
+ LSPDocumentID document;
LSPDocumentChangeEvent *changes; // dynamic array
} LSPRequestDidChange;
@@ -84,7 +84,7 @@ typedef struct {
} LSPRequestMessage;
typedef struct {
- DocumentID document;
+ LSPDocumentID document;
LSPPosition pos;
} LSPDocumentPosition;
@@ -240,13 +240,18 @@ typedef struct {
} u;
} LSPMessage;
+typedef struct {
+ char *path;
+ u32 version_number; // for LSP
+} LSPDocumentData;
+
typedef struct LSP {
Process process;
u32 request_id;
- StrHashTable document_ids; // values are u32. they are indices into document_filenames.
+ StrHashTable document_ids; // values are u32. they are indices into document_data.
// this is a dynamic array which just keeps growing.
// but the user isn't gonna open millions of files so it's fine.
- char **document_paths;
+ LSPDocumentData *document_data;
LSPMessage *messages;
SDL_mutex *messages_mutex;
LSPRequest *requests_client2server;