diff options
author | pommicket <pommicket@gmail.com> | 2023-01-07 16:09:30 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-07 16:09:30 -0500 |
commit | 66da8ac5dcfe02d3aa79f72ba415235eb872ec1d (patch) | |
tree | 651dbbeabf79f70b84f6e1c4394ebd703837737c /lsp.c | |
parent | 7640ecce499fc49cad3d9b9f391cce0b74e435c9 (diff) |
better request cancellation system
Diffstat (limited to 'lsp.c')
-rw-r--r-- | lsp.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -241,10 +241,10 @@ static bool request_type_is_notification(LSPRequestType type) { return false; } -LSPRequestID lsp_send_request(LSP *lsp, LSPRequest *request) { +LSPServerRequestID lsp_send_request(LSP *lsp, LSPRequest *request) { if (!lsp_supports_request(lsp, request)) { lsp_request_free(request); - return 0; + return (LSPServerRequestID){0}; } bool is_notification = request_type_is_notification(request->type); @@ -253,7 +253,10 @@ LSPRequestID lsp_send_request(LSP *lsp, LSPRequest *request) { LSPMessage message = {.type = LSP_REQUEST}; message.u.request = *request; lsp_send_message(lsp, &message); - return request->id; + return (LSPServerRequestID) { + .lsp = lsp->id, + .id = request->id + }; } void lsp_send_response(LSP *lsp, LSPResponse *response) { |