Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/BuildServerIntegration/BuildServerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ package actor BuildServerManager: QueueBasedMessageHandler {
}

package func mainFilesProvider<T: MainFilesProvider>(as: T.Type) async -> T? {
guard let mainFilesProvider = mainFilesProvider else {
guard let mainFilesProvider = await mainFilesProvider.value else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trap if mainFilesProvider was nil as it's IUO, but I assume it's fine because it's always initialized in init.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly. All the IUO members in SourceKit-LSP should be guaranteed to be initialized in init.

return nil
}
guard let index = await mainFilesProvider.value as? T else {
logger.fault("Expected the main files provider of the build server manager to be an `\(T.self)`")
guard let index = mainFilesProvider as? T else {
logger.fault("Expected the main files provider of the build server manager to be a '\(T.self)'")
return nil
}
return index
Expand Down