diff options
author | pommicket <pommicket@gmail.com> | 2022-12-07 13:05:02 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-07 13:05:02 -0500 |
commit | 65b72b38ec6c3a51b33e5d32313b51df993b32e4 (patch) | |
tree | e0805eb34d10dc0f90483f017f8ee80430bf61d9 /main.c | |
parent | 0c845d4308b7b255faf57f4e3bb95827e3cecc49 (diff) |
nice communication with LSP
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -288,8 +288,19 @@ int main(int argc, char **argv) { // @TODO TEMPORARY { LSP lsp={0}; - if (!lsp_create(&lsp, "rust-analyzer")) - printf("%s\n",lsp.error); + if (!lsp_create(&lsp, "rust-analyzer")) { + printf("lsp_create: %s\n",lsp.error); + exit(1); + } + while (1) { + JSON response = {0}; + if (lsp_next_response(&lsp, &response)) { + json_debug_print(&response); + break; + } + usleep(100000); + } + lsp_free(&lsp); exit(0); } |