From 9ee67ef5097451705b4ae9cb28895f726843cdf3 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 25 Dec 2022 15:58:30 -0500 Subject: handle complete vs incomplete lists --- lsp-parse.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lsp-parse.c') diff --git a/lsp-parse.c b/lsp-parse.c index 84b44e2..b5a05d0 100644 --- a/lsp-parse.c +++ b/lsp-parse.c @@ -113,6 +113,8 @@ static bool parse_completion(LSP *lsp, const JSON *json, LSPResponse *response) JSONValue result = json_get(json, "result"); JSONValue items_value = {0}; + completion->is_complete = true; // default + switch (result.type) { case JSON_NULL: // no completions @@ -122,6 +124,7 @@ static bool parse_completion(LSP *lsp, const JSON *json, LSPResponse *response) break; case JSON_OBJECT: items_value = json_object_get(json, result.val.object, "items"); + completion->is_complete = !json_object_get_bool(json, result.val.object, "isIncomplete", false); break; default: lsp_set_error(lsp, "Weird result type for textDocument/completion response: %s.", json_type_to_str(result.type)); -- cgit v1.2.3