Don’t block the generation of a build system by build graph generation

We currently load the entire package before generating a `SwiftPMBuildSystem`. That means that the initialize request to SourceKit-LSP is blocked until the package has been loaded, preventing us from offering any sort of functionality, including syntactic functionality like formatting.

Decouple build system creation and build graph generation (aka. package loading for SwiftPM). We can operate with fallback build settings until the build graph has been loaded and reopen the document once the proper build settings are available.

rdar://126644596
This commit is contained in:
Alex Hoppen
2024-08-16 18:15:20 -07:00
parent 1f6bfce77c
commit 6e0281f79a
14 changed files with 251 additions and 147 deletions

View File

@@ -281,7 +281,9 @@ extension BuildServerBuildSystem: BuildSystem {
return [ConfiguredTarget(targetID: "dummy", runDestinationID: "dummy")]
}
package func generateBuildGraph(allowFileSystemWrites: Bool) {}
package func generateBuildGraph() {}
package func waitForUpToDateBuildGraph() async {}
package func topologicalSort(of targets: [ConfiguredTarget]) async -> [ConfiguredTarget]? {
return nil