diff options
author | pommicket <pommicket@gmail.com> | 2022-12-09 22:43:45 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-09 22:43:45 -0500 |
commit | 8362c840c3c3afefa56ecaef68d1c926c9ee118b (patch) | |
tree | 96052e88741b1884cca3a84a4eae7aa3655860f7 /main.c | |
parent | 78c3046bdd2c9db044a6178536e274cdc0b20120 (diff) |
more completion, not working yet
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -308,7 +308,19 @@ int main(int argc, char **argv) { LSPMessage message = {0}; while (lsp_next_message(&lsp, &message)) { if (message.type == LSP_RESPONSE) { - printf("response type %u\n",message.u.response.type); + const LSPResponse *response = &message.u.response; + switch (response->type) { + case LSP_COMPLETION: { + const LSPResponseCompletion *completion = &response->data.completion; + arr_foreach_ptr(completion->items, LSPCompletionItem, item) { + printf("%s:%s\n", + lsp_response_string(response, item->sort_text), + lsp_response_string(response, item->label)); + } + } break; + default: + break; + } } else if (message.type == LSP_REQUEST) { const LSPRequest *request = &message.u.request; switch (request->type) { |