diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -292,8 +292,9 @@ int main(int argc, char **argv) { printf("lsp_create: %s\n",lsp.error); exit(1); } -// LSPRequest test_req = {LSP_COMPLETION}; -// lsp_send_request(&lsp, &test_req); + usleep(500000);//if we don't do this we get "waiting for cargo metadata or cargo check" + LSPRequest test_req = {.type = LSP_COMPLETION}; + lsp_send_request(&lsp, &test_req); while (1) { JSON response = {0}; if (lsp_next_response(&lsp, &response)) { @@ -301,6 +302,10 @@ int main(int argc, char **argv) { printf("\n"); break; } + char error[256]; + if (lsp_get_error(&lsp, error, sizeof error, true)) { + printf("lsp error: %s\n", error); + } usleep(10000); } lsp_free(&lsp); |