diff options
author | pommicket <pommicket@gmail.com> | 2022-12-25 15:58:30 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-25 15:58:30 -0500 |
commit | 9ee67ef5097451705b4ae9cb28895f726843cdf3 (patch) | |
tree | 6342192680691acb9151938c06f699e876c17819 /lsp-parse.c | |
parent | f67094bce357a76334a717ed669b377d3b93d18e (diff) |
handle complete vs incomplete lists
Diffstat (limited to 'lsp-parse.c')
-rw-r--r-- | lsp-parse.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)); |