Skip to content

Commit 60d2876

Browse files
committed
Add workaround for rdar://116221716
1 parent 1e0639c commit 60d2876

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SourceKitLSP/WorkDoneProgressManager.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,19 @@ final actor WorkDoneProgressManager {
5151
/// The last status that was sent to the client. Used so we don't send no-op updates to the client.
5252
private var lastStatus: Status? = nil
5353

54+
/// Needed to work around rdar://116221716
55+
private static func getServerCapabilityRegistry(_ server: SourceKitLSPServer) async -> CapabilityRegistry? {
56+
return await server.capabilityRegistry
57+
}
58+
5459
init?(
5560
server: SourceKitLSPServer,
5661
initialDebounce: Duration? = nil,
5762
title: String,
5863
message: String? = nil,
5964
percentage: Int? = nil
6065
) async {
61-
guard let capabilityRegistry = await server.capabilityRegistry else {
66+
guard let capabilityRegistry = await Self.getServerCapabilityRegistry(server) else {
6267
return nil
6368
}
6469
self.init(

0 commit comments

Comments
 (0)