diff options
author | pommicket <pommicket@gmail.com> | 2022-12-20 12:25:18 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-20 12:25:18 -0500 |
commit | caf81c5a2c8b9432792c652edd0dcf1f64f7a4f1 (patch) | |
tree | dc1d327aff19b59b7fc636cce42d588e94c168ef /lsp.c | |
parent | 8deb7afed44d7be52cb450c3177ecc8e63fd46eb (diff) |
start didChange
Diffstat (limited to 'lsp.c')
-rw-r--r-- | lsp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -42,7 +42,7 @@ static void lsp_request_free(LSPRequest *r) { } break; case LSP_REQUEST_DID_OPEN: { LSPRequestDidOpen *open = &r->data.open; - free(open->path); + free(open->document); free(open->file_contents); } break; case LSP_REQUEST_SHOW_MESSAGE: @@ -618,7 +618,9 @@ void lsp_free(LSP *lsp) { void lsp_document_changed(LSP *lsp, const char *document, LSPDocumentChangeEvent change) { // @TODO(optimization, eventually): batch changes (using the contentChanges array) - //LSPRequest request = {.type = LSP_REQUEST_DID_CHANGE}; - //LSPRequestDidChange *change = &request.change; - abort(); // @TODO + LSPRequest request = {.type = LSP_REQUEST_DID_CHANGE}; + LSPRequestDidChange *c = &request.data.change; + c->document = str_dup(document); + arr_add(c->changes, change); + lsp_send_request(lsp, &request); } |