Skip to content

Conversation

@roulpriya
Copy link
Contributor

@roulpriya roulpriya commented Oct 7, 2025

Description

Install Swiftly from extension

Issue: Please provide reference link to the Github issue

Tasks

  • Required tests have been written
  • Documentation has been updated
  • Added an entry to CHANGELOG.md if applicable

@roulpriya roulpriya force-pushed the swiftly-install-via-vscode branch from 7905f88 to bbbe271 Compare October 7, 2025 17:56
@roulpriya roulpriya force-pushed the swiftly-install-via-vscode branch from bbbe271 to d6cb6ce Compare October 30, 2025 04:14
@roulpriya roulpriya marked this pull request as ready for review October 30, 2025 04:15
@roulpriya roulpriya force-pushed the swiftly-install-via-vscode branch from d6cb6ce to 582b344 Compare November 15, 2025 06:38
Copy link
Member

@matthewbastien matthewbastien left a comment

Choose a reason for hiding this comment

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

Looking good so far, thank you! I have several comments from my first look at this.

You'll also have to rebase on top of main before adding to the changelog.

"order": 4,
"scope": "machine-overridable"
},
"swift.suppressSwiftlyInstallPrompt": {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Just to keep this consistent with other setting names:

Suggested change
"swift.suppressSwiftlyInstallPrompt": {
"swift.disableSwiftlyInstallPrompt": {

/**
* Checks if any workspace folder contains a .swift-version file
*/
async function hasSwiftVersionFile(): Promise<boolean> {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: We should probably also check the FolderContext directories since a user can open a top level folder with multiple sub-folders that have a Package.swift. Maybe even just make this check happen at the FolderContext or WorkspaceContext level?

): Promise<SwiftToolchain | undefined> {
// Check if there's a .swift-version file in the workspace and Swiftly is not installed
if (await hasSwiftVersionFile()) {
const { Swiftly } = await import("./toolchain/swiftly");
Copy link
Member

Choose a reason for hiding this comment

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

issue: Keep the imports at the top level. Makes it easier to see where the dependencies are.

});
});

suite("installSwiftly()", () => {
Copy link
Member

Choose a reason for hiding this comment

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

issue: These tests appear to actually be attempting to decompress artifacts judging by some of the error messages in CI. You'll have to find some way to abstract away tar with dependency injection. It honestly might be easier to do an integration test for the install. However, performing a swiftly init is going to mess with environment variables which could pose problems.

A bunch of these tests are failing in CI which will need to be fixed up.

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.

2 participants