mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Fix a race condition that could cause the build graph to not be generated when doing initial background indexing
We were making the initial `generateBuildGraph` call in `SourceKitLSPServer` from a `Task`. This means that `generateBuildGraph` could be executed after `waitForUpToDateBuildGraph` was called by `SemanticIndexManager`. Thus `waitForUpToDateBuildGraph` returned immediately and no files were background indexed. Make `generateBuildGraph` immediately schedule a package reload for SwiftPM build systems instead of doing the hop through a `Task`, fixing the race condition. rdar://135551812
This commit is contained in:
@@ -133,7 +133,7 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
|
||||
throw PrepareNotSupportedError()
|
||||
}
|
||||
|
||||
package func generateBuildGraph() {}
|
||||
package func scheduleBuildGraphGeneration() {}
|
||||
|
||||
package func waitForUpToDateBuildGraph() async {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user