diff options
author | pommicket <pommicket@gmail.com> | 2023-09-09 22:14:25 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-09 22:14:25 -0400 |
commit | c9c4b74376017b52a024705622c42d7d35c5bda0 (patch) | |
tree | b6f4b504a2d2adcd47151d3bd88c0b8147140801 /lsp.c | |
parent | 16fbe87451b0ca3e8fa35fd04e0afbfab368ea65 (diff) |
start incremental sync support
Diffstat (limited to 'lsp.c')
-rw-r--r-- | lsp.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -227,12 +227,14 @@ static bool lsp_supports_request(LSP *lsp, const LSPRequest *request) { case LSP_REQUEST_WORKSPACE_FOLDERS: case LSP_REQUEST_PUBLISH_DIAGNOSTICS: return false; - case LSP_REQUEST_INITIALIZE: - case LSP_REQUEST_INITIALIZED: - case LSP_REQUEST_CANCEL: case LSP_REQUEST_DID_OPEN: case LSP_REQUEST_DID_CLOSE: + return cap->open_close_support; case LSP_REQUEST_DID_CHANGE: + return cap->sync_support; + case LSP_REQUEST_INITIALIZE: + case LSP_REQUEST_INITIALIZED: + case LSP_REQUEST_CANCEL: case LSP_REQUEST_CONFIGURATION: case LSP_REQUEST_SHUTDOWN: case LSP_REQUEST_EXIT: @@ -436,8 +438,11 @@ static bool lsp_receive(LSP *lsp, size_t max_size) { // kind of a hack. this is needed because arr_set_len zeroes the data. arr_hdr_(lsp->received_data)->len = (u32)received_so_far; lsp->received_data[received_so_far] = '\0';// null terminate - #if LSP_SHOW_S2C - printf("%s%s%s\n",term_italics(stdout),lsp->received_data,term_clear(stdout)); + #if 0 + const int limit = 1000; + printf("%s%.*s%s%s\n",term_italics(stdout),limit,lsp->received_data, + strlen(lsp->received_data) > (size_t)limit ? "..." : "", + term_clear(stdout)); #endif u64 response_offset=0, response_size=0; |