summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-09 22:43:45 -0500
committerpommicket <pommicket@gmail.com>2022-12-09 22:43:45 -0500
commit8362c840c3c3afefa56ecaef68d1c926c9ee118b (patch)
tree96052e88741b1884cca3a84a4eae7aa3655860f7 /main.c
parent78c3046bdd2c9db044a6178536e274cdc0b20120 (diff)
more completion, not working yet
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.c b/main.c
index 28fb1d6..c388b63 100644
--- a/main.c
+++ b/main.c
@@ -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) {