From 84da626a18ccc779aef4a178ee0097a93c959520 Mon Sep 17 00:00:00 2001 From: pommicket Date: Mon, 29 Sep 2025 15:11:47 -0400 Subject: Send over diagnostics; this fixes code actions --- lsp-parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lsp-parse.c') 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; } -- cgit v1.2.3