Skip to content

Add swiftly to walkthrough#2078

Open
thePianoKid wants to merge 10 commits intoswiftlang:mainfrom
thePianoKid:add-swiftly-to-walkthrough
Open

Add swiftly to walkthrough#2078
thePianoKid wants to merge 10 commits intoswiftlang:mainfrom
thePianoKid:add-swiftly-to-walkthrough

Conversation

@thePianoKid
Copy link
Contributor

@thePianoKid thePianoKid commented Feb 2, 2026

Description

Now that Swiftly support has been integrated into the extension, it makes sense to add it to the welcome walkthrough. This PR adds a new step to the welcome walkthrough that explains what a toolchain is, what Swiftly is, and includes a button users can press to install Swiftly on their system.

Issue: partially addresses #1561

Tasks

  • Required tests have been written
  • No automated tests were written, but these manual tests were performed:
    • Made sure the "install Swiftly" step did not render when the extension was running on a Windows machine:
      Screenshot 2026-02-02 at 4 38 26 PM
    • The "install Swiftly" step renders on macOS and Linux
    • The "install" Swiftly step is marked as completed only when Swiftly has been added to PATH
      • ⚠️ You need to restart VSCode for it to release that the PATH has been updated. This might be confusing to users. Thankfully, we prompt the user to restart their editor once Swiftly is installed.
  • Documentation has been updated
  • Added an entry to CHANGELOG.md if applicable

@thePianoKid thePianoKid marked this pull request as ready for review February 2, 2026 22:56
Copy link
Contributor

@plemarquand plemarquand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@rbenegal rbenegal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Looking good, left some comments for your consideration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I was thinking the first "Install Swift" step could also have an Install Swiftly and Swift Toolchain button instead of being told to manually install from swift.org. Possibly can detect whether the user has an existing toolchain (or Xcode installed) and if they don't they can click a button and have the extension set everything up?


![Install Swiftly](./images/installSwiftly.png)

A toolchain is the complete set of tools needed to compile and run Swift code. [Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs/) is a toolchain manager and installer that allows you to switch between different toolchains. If you're familiar with the JS ecosystem, Swiftly is roughly equivalent to [nvm](https://www.nvmnode.com).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if a comparison with other tools is required here (there's plenty of other similar tools like rustup etc. and hard to say what the user would be familiar with). Probably best to stick with just swiftly.

}
}

export async function runInstallSwiftly(logger?: SwiftLogger): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a copy of promptForSwiftlyInstallation with slight changes? Wondering if it would be better to refactor to avoid duplication for future maintenance possibly?

@thePianoKid thePianoKid force-pushed the add-swiftly-to-walkthrough branch from b090715 to e8352a7 Compare February 4, 2026 13:14
@thePianoKid
Copy link
Contributor Author

After an offline conversation with @rbenegal, we decided to add this step to the first step on the welcome page. I've refactored accordingly.

src/extension.ts Outdated
});

const installCommand = vscode.commands.registerCommand(
"sswg.swift.installSwift",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be using sswg.swift anymore since that was the name of the old deprecated swift extension. Probably just swift.installSwift is good. Also this should be done in commands.ts and not here I believe.

// Show the error dialog asynchronously without blocking activation.
// This prevents a UI deadlock where the walkthrough buttons can't work
// because activation is blocked waiting for the user to dismiss the dialog.
void showToolchainError().then(chosenRemediation => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this was the only way to get the "Install Swift" button to work while there was no Swift toolchain installed (which is the most important time for that button to work!)

const swiftlyCheckElapsed = Date.now() - swiftlyCheckStartTime;

const swiftLangCheckStartTime = Date.now();
await checkForSwiftLangInstallation();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we can render a checkmark when swift --version returns something.

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.

3 participants