Closed matthewbastien closed 2 months ago
@swift-server-bot test this please
@swift-server-bot add to allowlist
CI is returning a bunch of errors for older versions of swift. New features can probably be gated on the last three versions of swift. Get it working for 5.8 if it works for all the earlier swift versions as well you are done. Otherwise Add a new contextKey newProjectAvailable
in contextKeys.ts and use the contextKey to control availability of the command. At startup you can check the swift version and set it to false if the swift version is less than 5.8
CI is returning a bunch of errors for older versions of swift. New features can probably be gated on the last three versions of swift. Get it working for 5.8 if it works for all the earlier swift versions as well you are done. Otherwise Add a new contextKey
newProjectAvailable
in contextKeys.ts and use the contextKey to control availability of the command. At startup you can check the swift version and set it to false if the swift version is less than 5.8
The output of swift package init --help
changes pretty drastically in versions <5.8.0. I've added the context key for enablement of the command, but we still need to support users being able to create a project in cases where the Swift extension is not activated yet (e.g. when no workspace is open). As such, I've also added a swift.isActivated
context key to detect this. An error is shown to the user if they try to use the create project command with an unsupported swift version.
Implementation of the feature request #754.
The workflow is as follows:
Swift: New Project
swift package init --help
.swift package init
is executed to create the project based on the given inputs.swift.openAfterCreateProject
setting. This is essentially the same modal used by theGit: Clone
command.I've also added a fairly basic test to make sure that the parsing of
swift package init --help
is functioning as intended.Feedback is greatly appreciated! This is my first commit to this project and I definitely don't know all the ins and outs to the code base.