diff --git a/Sources/SourceKitLSP/SourceKitLSPServer.swift b/Sources/SourceKitLSP/SourceKitLSPServer.swift index 05ae24aaf..d7db1ee1f 100644 --- a/Sources/SourceKitLSP/SourceKitLSPServer.swift +++ b/Sources/SourceKitLSP/SourceKitLSPServer.swift @@ -1158,6 +1158,8 @@ extension SourceKitLSPServer { await workspace.buildSystemManager.setMainFilesProvider(nil) workspace.closeIndex() } + // Make sure we emit all pending log messages. When we're not using `NonDarwinLogger` this is a no-op. + await NonDarwinLogger.flush() } func shutdown(_ request: ShutdownRequest) async throws -> ShutdownRequest.Response {