-
Notifications
You must be signed in to change notification settings - Fork 314
Don’t block the generation of a build system by build graph generation #1632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please test |
|
||
/// Check that the entries in `uriToWorkspace` are still up-to-date after workspaces might have changed. | ||
/// | ||
/// For any entries that are not up-to-date, close the document in the old workspace and open it in the new document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// For any entries that are not up-to-date, close the document in the old workspace and open it in the new document. | |
/// For any entries that are not up-to-date, close the document in the old workspace and open it in the new workspace. |
package func generateBuildGraph(allowFileSystemWrites: Bool) async throws { | ||
try await self.reloadPackage(forceResolvedVersions: !isForIndexBuild || !allowFileSystemWrites) | ||
package func generateBuildGraph() async throws { | ||
try await self.reloadPackage(forceResolvedVersions: !isForIndexBuild) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forceResolvedVersions
is now always !isForIndexBuild
, is it worth keeping it as a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, I didn’t notice we can remove it even one level further. 👍🏽
c8454f5
to
0151a0f
Compare
@swift-ci Please test |
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
0151a0f
to
6e0281f
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
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