Skip to content

Commit f7ab6c5

Browse files
committed
Flush the NonDarwinLogger before shutting down SourceKitLSPServer
This ensures that we don't drop any log messages when stopping the LSP server, in particular while running tests.
1 parent bb699c9 commit f7ab6c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,8 @@ extension SourceKitLSPServer {
11581158
await workspace.buildSystemManager.setMainFilesProvider(nil)
11591159
workspace.closeIndex()
11601160
}
1161+
// Make sure we emit all pending log messages. When we're not using `NonDarwinLogger` this is a no-op.
1162+
await NonDarwinLogger.flush()
11611163
}
11621164

11631165
func shutdown(_ request: ShutdownRequest) async throws -> ShutdownRequest.Response {

0 commit comments

Comments
 (0)