summaryrefslogtreecommitdiff
path: root/lsp.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-07 16:09:30 -0500
committerpommicket <pommicket@gmail.com>2023-01-07 16:09:30 -0500
commit66da8ac5dcfe02d3aa79f72ba415235eb872ec1d (patch)
tree651dbbeabf79f70b84f6e1c4394ebd703837737c /lsp.h
parent7640ecce499fc49cad3d9b9f391cce0b74e435c9 (diff)
better request cancellation system
Diffstat (limited to 'lsp.h')
-rw-r--r--lsp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/lsp.h b/lsp.h
index b87f2a9..61c5610 100644
--- a/lsp.h
+++ b/lsp.h
@@ -18,6 +18,12 @@ typedef struct SDL_mutex *LSPMutex;
typedef struct SDL_semaphore *LSPSemaphore;
typedef struct SDL_Thread *LSPThread;
+// a struct for keeping track of a LSP server ID and a request ID
+typedef struct {
+ LSPID lsp;
+ LSPRequestID id;
+} LSPServerRequestID;
+
// interface Position in the LSP spec
typedef struct {
u32 line;
@@ -587,9 +593,9 @@ void lsp_message_free(LSPMessage *message);
u32 lsp_document_id(LSP *lsp, const char *path);
// returned pointer lives as long as lsp.
const char *lsp_document_path(LSP *lsp, LSPDocumentID id);
-// returns the ID of the sent request, or 0 if the request is not supported by the LSP
+// returns the ID of the sent request, or (LSPServerRequestID){0} if the request is not supported by the LSP
// don't free the contents of this request (even on failure)! let me handle it!
-LSPRequestID lsp_send_request(LSP *lsp, LSPRequest *request);
+LSPServerRequestID lsp_send_request(LSP *lsp, LSPRequest *request);
// send a $/cancelRequest notification
// if id = 0, nothing will happen.
void lsp_cancel_request(LSP *lsp, LSPRequestID id);