From a64b63333ab67924ce36edd9b2d9bb4a371a843d Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Sun, 21 May 2023 22:56:42 +0200 Subject: [PATCH] invalidate Analyser on didClose --- src/Server.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Server.zig b/src/Server.zig index 213b87e..7e6d252 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -819,6 +819,9 @@ fn saveDocumentHandler(server: *Server, notification: types.DidSaveTextDocumentP } fn closeDocumentHandler(server: *Server, notification: types.DidCloseTextDocumentParams) error{}!void { + // cached type info may point to a closed handle + server.analyser.invalidate(); + server.document_store.closeDocument(notification.textDocument.uri); }