summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-07 13:05:02 -0500
committerpommicket <pommicket@gmail.com>2022-12-07 13:05:02 -0500
commit65b72b38ec6c3a51b33e5d32313b51df993b32e4 (patch)
treee0805eb34d10dc0f90483f017f8ee80430bf61d9 /main.c
parent0c845d4308b7b255faf57f4e3bb95827e3cecc49 (diff)
nice communication with LSP
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.c b/main.c
index acdbea0..2792bd9 100644
--- a/main.c
+++ b/main.c
@@ -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);
}