From 48689c119011cb114b7bab8c519e34b3f60e0b23 Mon Sep 17 00:00:00 2001 From: Nimaoth Date: Mon, 29 Jul 2024 23:15:18 +0200 Subject: [PATCH] Fixed diagnostics not being cleaned up properly --- src/text/text_document.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/text/text_document.nim b/src/text/text_document.nim index b214e673..2a3883ad 100644 --- a/src/text/text_document.nim +++ b/src/text/text_document.nim @@ -1183,6 +1183,10 @@ proc getLanguageServer*(self: TextDocument): Future[Option[LanguageServer]] {.as self.onDiagnosticsHandle = ls.onDiagnostics.subscribe proc(diagnostics: lsp_types.PublicDiagnosticsParams) = let uri = diagnostics.uri.decodeUrl.parseUri if uri.path.normalizePathUnix == self.filename: + + for line in self.diagnosticsPerLine.keys: + self.styledTextCache.del(line) + self.currentDiagnostics.setLen diagnostics.diagnostics.len self.diagnosticsPerLine.clear()