mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Change the build system to only notify delegate about changed files, not about new build settings
This defines away an entire class of data races if delegate callbacks are delivered out-of-order. If we aren’t providing the new build settings in the delegate callback, then it doesn’t matter if two `fileBuildSettingsChanged` calls change order since they don’t carry any state.
This commit is contained in:
@@ -202,11 +202,7 @@ public actor BuildServerBuildSystem: MessageHandler {
|
||||
/// about the changed build settings.
|
||||
private func buildSettingsChanged(for document: DocumentURI, settings: FileBuildSettings?) async {
|
||||
buildSettings[document] = settings
|
||||
if let settings {
|
||||
await self.delegate?.fileBuildSettingsChanged([document: .modified(settings)])
|
||||
} else {
|
||||
await self.delegate?.fileBuildSettingsChanged([document: .removedOrUnavailable])
|
||||
}
|
||||
await self.delegate?.fileBuildSettingsChanged([document])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user