Skip to content

Enable installing Swiftly via Select Toolchain command#2121

Open
vanshkamra12 wants to merge 1 commit into
swiftlang:mainfrom
vanshkamra12:feature/install-swiftly-via-select-toolchain
Open

Enable installing Swiftly via Select Toolchain command#2121
vanshkamra12 wants to merge 1 commit into
swiftlang:mainfrom
vanshkamra12:feature/install-swiftly-via-select-toolchain

Conversation

@vanshkamra12

Copy link
Copy Markdown

Fixes #2065

-> Problem
Previously, when users ran the "Swift: Select Toolchain" command and Swiftly was not installed, they were only directed to the Swift.org website with a link. This required leaving VS Code, manually installing Swiftly via terminal commands, and then restarting VS Code.

-> Solution
This PR adds a new "Install Swiftly for toolchain management..." action that appears in the Select Toolchain quick pick when:

Swiftly is not installed
The platform is macOS or Linux (where Swiftly is supported)
When the user selects this action:

A confirmation dialog appears explaining what will happen
User can choose:
Continue - Proceeds with installation
Open Swiftly Documentation - Opens the Swiftly docs for manual installation
Cancel - Dismisses the dialog
If user continues, Swiftly installs with a progress notification
After successful installation, user is prompted to restart VS Code

Added comprehensive test suite "Install Swiftly action" with 5 test cases:
Shows action when Swiftly not installed
Hides action when Swiftly is installed
Installs Swiftly when user confirms
Does not install when user cancels
Opens documentation when user selects doc link

-> Testing
All existing tests pass, plus 5 new unit tests covering:

- Add installSwiftly() function to show confirmation dialog and install Swiftly
- Export installSwiftlyWithProgress and promptToRestartVSCode functions
- Show 'Install Swiftly for toolchain management' action when Swiftly not installed
- Add comprehensive test coverage for all user flows

Fixes swiftlang#2065
@vanshkamra12

Copy link
Copy Markdown
Author

@adam-fowler @0xTim @award999 please review this...!!

@award999

Copy link
Copy Markdown
Contributor

@matthewbastien would be the best reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable installing swiftly via Select Toolchain command

2 participants