summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-09 22:47:31 -0500
committerpommicket <pommicket@gmail.com>2022-12-09 22:47:31 -0500
commit4c5be13a9bcd298f01252f71579cd86c7e487966 (patch)
treef1bafee3a57a9e3782060b2f3579012a9041074c /lsp.c
parentc82287a70f41a96db3639bfa1f0c848f9adc1ab4 (diff)
pass by value intead of poitner
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lsp.c b/lsp.c
index 61ba014..83afa0e 100644
--- a/lsp.c
+++ b/lsp.c
@@ -1,5 +1,4 @@
// @TODO:
-// - make json_object/array_get take value not pointer
// - documentation
// - make sure offsets are utf-16!
// - maximum queue size for requests/responses just in case?
@@ -484,7 +483,7 @@ static bool parse_completion(LSP *lsp, const JSON *json, LSPResponse *response)
items_value = result;
break;
case JSON_OBJECT:
- items_value = json_object_get(json, &result.val.object, "items");
+ items_value = json_object_get(json, result.val.object, "items");
break;
default:
lsp_set_error(lsp, "Weird result type for textDocument/completion response: %s.", json_type_to_str(result.type));
@@ -501,18 +500,18 @@ static bool parse_completion(LSP *lsp, const JSON *json, LSPResponse *response)
for (u32 i = 0; i < items.len; ++i) {
LSPCompletionItem *item = &completion->items[i];
- JSONValue item_value = json_array_get(json, &items, i);
+ JSONValue item_value = json_array_get(json, items, i);
if (!lsp_expect_object(lsp, item_value, "completion list"))
return false;
JSONObject item_object = item_value.val.object;
- JSONValue label_value = json_object_get(json, &item_object, "label");
+ JSONValue label_value = json_object_get(json, item_object, "label");
if (!lsp_expect_string(lsp, label_value, "completion label"))
return false;
JSONString label = label_value.val.string;
JSONString sort_text = label;
- JSONValue sort_text_value = json_object_get(json, &item_object, "sortText");
+ JSONValue sort_text_value = json_object_get(json, item_object, "sortText");
if (sort_text_value.type == JSON_STRING) {
// LSP allows using a different string for sorting.
sort_text = sort_text_value.val.string;