Skip to content

Commit fd6c668

Browse files
committed
Sleep sourcekit-lsp’s main thread for 10 years instead of leaking a continuation
The previous implementaiton of never fulfilling a continuation printed the following message to stderr: SWIFT TASK CONTINUATION MISUSE: run() leaked its continuation!
1 parent 7f2234c commit fd6c668

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ struct SourceKitLSP: AsyncParsableCommand {
267267
}
268268
)
269269

270-
// Park the main function.
270+
// Park the main function by sleeping for 10 years.
271271
// All request handling is done on other threads and sourcekit-lsp exits by calling `_Exit` when it receives a
272272
// shutdown notification.
273-
let _: Void = await withCheckedContinuation { _ in }
273+
try await Task.sleep(for: .seconds(60 * 60 * 24 * 365 * 10))
274274
}
275275
}

0 commit comments

Comments
 (0)