From d86d05d969c6872f2fa0786a23ffe5e682985e6a Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Fri, 30 Dec 2022 23:43:40 +0000 Subject: [PATCH] fix ast-check with single error (#865) --- src/Server.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Server.zig b/src/Server.zig index 5bc705c..ccf51d4 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -453,6 +453,12 @@ fn getAstCheckDiagnostics( }; } } + + if (last_diagnostic) |*diagnostic| { + diagnostic.relatedInformation = try last_related_diagnostics.toOwnedSlice(allocator); + try diagnostics.append(allocator, diagnostic.*); + last_diagnostic = null; + } } /// caller owns returned memory.