-
Notifications
You must be signed in to change notification settings - Fork 89
Add Swiftly installation support #1881
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
base: main
Are you sure you want to change the base?
Conversation
7905f88 to
bbbe271
Compare
bbbe271 to
d6cb6ce
Compare
d6cb6ce to
582b344
Compare
matthewbastien
left a comment
There was a problem hiding this 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": { |
There was a problem hiding this comment.
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:
| "swift.suppressSwiftlyInstallPrompt": { | |
| "swift.disableSwiftlyInstallPrompt": { |
| /** | ||
| * Checks if any workspace folder contains a .swift-version file | ||
| */ | ||
| async function hasSwiftVersionFile(): Promise<boolean> { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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()", () => { |
There was a problem hiding this comment.
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.
Description
Install Swiftly from extension
Issue: Please provide reference link to the Github issue
Tasks