diff options
author | pommicket <pommicket@gmail.com> | 2025-09-29 15:11:47 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-29 15:29:51 -0400 |
commit | 84da626a18ccc779aef4a178ee0097a93c959520 (patch) | |
tree | ea862eff35309f2cae3a0ab30112fb38647eafa2 /lsp-parse.c | |
parent | 16b5baf3083c982220e9feb561f2f53f1720fe2a (diff) |
Send over diagnostics; this fixes code actions
Diffstat (limited to 'lsp-parse.c')
-rw-r--r-- | lsp-parse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lsp-parse.c b/lsp-parse.c index 3f81a2f..4046f6f 100644 --- a/lsp-parse.c +++ b/lsp-parse.c @@ -800,10 +800,14 @@ static bool parse_publish_diagnostics(LSP *lsp, const JSON *json, LSPRequest *re return false; JSONArray diagnostics = json_object_get_array(json, params, "diagnostics"); for (u32 i = 0; i < diagnostics.len; ++i) { - JSONObject diagnostic_in = json_array_get_object(json, diagnostics, i); + JSONValue diagnostic_val = json_array_get(json, diagnostics, i); + JSONObject diagnostic_in = json_force_object(diagnostic_val); LSPDiagnostic *diagnostic_out = arr_addp(pub->diagnostics); if (!parse_diagnostic(lsp, request, json, diagnostic_in, diagnostic_out)) return false; + char *raw = json_reserialize(json, diagnostic_val); + diagnostic_out->raw = lsp_request_add_string(request, raw); + free(raw); } return true; } |