summaryrefslogtreecommitdiff
path: root/lsp-parse.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-03 23:50:50 -0500
committerpommicket <pommicket@gmail.com>2023-01-03 23:50:50 -0500
commit3756a3e47221c3b0133724a482341a9010076a9e (patch)
tree7ad68fd0b76bd0e132fd86cd5044c3e08d581d22 /lsp-parse.c
parent4e73c6a204383667aad6ce3905e16aee2a172fb6 (diff)
read workspace/symbols containerName
Diffstat (limited to 'lsp-parse.c')
-rw-r--r--lsp-parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lsp-parse.c b/lsp-parse.c
index 4c3e95f..c6c15ff 100644
--- a/lsp-parse.c
+++ b/lsp-parse.c
@@ -32,6 +32,9 @@ static WarnUnusedResult bool lsp_expect_number(LSP *lsp, JSONValue value, const
static LSPString lsp_response_add_json_string(LSPResponse *response, const JSON *json, JSONString string) {
+ if (string.len == 0) {
+ return (LSPString){0};
+ }
u32 offset = arr_len(response->string_data);
arr_set_len(response->string_data, offset + string.len + 1);
json_string_get(json, string, response->string_data + offset, string.len + 1);
@@ -608,6 +611,10 @@ static bool parse_symbol_information(LSP *lsp, const JSON *json, JSONValue value
if (!parse_location(lsp, json, location, &info->location))
return false;
+ // get container name
+ JSONString container = json_object_get_string(json, object, "containerName");
+ info->container = lsp_response_add_json_string(response, json, container);
+
return true;
}