Revert asyncificaiton changes

The asyncification changes caused some non-deterministic test failures. I believe that some of these are due to race conditions that are the result of the partial transition to actors.

Instead of merging the asyncification piece by piece, I will collect the changes asyncification changes in a branch and then qualify that branch througougly (running CI multiple times) before merging it into `main`.
This commit is contained in:
Alex Hoppen
2023-09-30 10:09:59 -07:00
parent 1606e7316f
commit b22af35eb1
55 changed files with 2548 additions and 2845 deletions

View File

@@ -38,17 +38,13 @@ public final class FallbackBuildSystem: BuildSystem {
/// Delegate to handle any build system events.
public weak var delegate: BuildSystemDelegate? = nil
public func setDelegate(_ delegate: BuildSystemDelegate?) async {
self.delegate = delegate
}
public var indexStorePath: AbsolutePath? { return nil }
public var indexDatabasePath: AbsolutePath? { return nil }
public var indexPrefixMappings: [PathPrefixMapping] { return [] }
public func buildSettings(for uri: DocumentURI, language: Language) -> FileBuildSettings? {
public func settings(for uri: DocumentURI, _ language: Language) -> FileBuildSettings? {
switch language {
case .swift:
return settingsSwift(uri.pseudoPath)
@@ -62,9 +58,9 @@ public final class FallbackBuildSystem: BuildSystem {
public func registerForChangeNotifications(for uri: DocumentURI, language: Language) {
guard let delegate = self.delegate else { return }
let settings = self.buildSettings(for: uri, language: language)
Task {
await delegate.fileBuildSettingsChanged([uri: FileBuildSettingsChange(settings)])
let settings = self.settings(for: uri, language)
DispatchQueue.global().async {
delegate.fileBuildSettingsChanged([uri: FileBuildSettingsChange(settings)])
}
}