-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support Swift SDKs #1191
base: main
Are you sure you want to change the base?
Support Swift SDKs #1191
Conversation
We need a swiftlang/swift-package-manager#6828 like solution on Windows before we can get rid of |
@kabiroberai can you rebase please? We recently moved to GitHub actions to verify PRs |
b0d8aa3
to
d9a6fe9
Compare
@award999 done! |
Heya @award999, any updates on this? CI is green now ✅ |
Thanks for the contribution @kabiroberai! In answer to your questions:
As long as SwiftPM continues to support the --sdk option, the old swift.SDK parameter should stick around.
The extension typically follows the pattern that the command is always enabled. If the command can't run, it presents an errorMessage. This allows presenting to the user the reason why the command couldn't be run (as opposed to it just not being there). For example "You don't have an SDK selected" vs. "This feature is only supported on Swift 6.0 and higher". An example of this behaviour can be found at
|
ty folks! since we're keeping the SDK parameter around (and I realized SourceKit LSP's |
This PR adds support for Swift SDKs when using the SwiftPM build system, as defined by SE-0387. These are already supported by SourceKit LSP, so adding support here is primarily a matter of plumbing the
swift.swiftSDK
parameter along to theswiftPM.swiftSDK
field of SourceKit LSP's startup options.Additionally, with swiftlang/swift-package-manager#6828 it is now possible to select Darwin triples as Swift SDKs on macOS — that is, you can build for iOS withswift build --swift-sdk arm64-apple-ios
and so on. This support also applies to SourceKit LSP, and so we can update the "Select Target Platform" action to pick a Swift SDK instead.Open questions
This PR mostly obsoletes the oldswift.SDK
parameter, but I haven't removed it yet because 1) Swift SDK support only works with SwiftPM right now and 2) I'm not sure whether removingswift.SDK
would break the Windows-specific use cases for that parameter. Removing it would clean up a lot of code though. Would this be reasonable to do?Support for Darwin SDKs as Swift SDKs is on main and has landed in time for the 6.1 release cut, but doesn't exist in 6.0. Is there a recommended pattern we can use for feature detection to only surface the "Select Target Platform" command if the compiler is new enough?TODO: