-
Notifications
You must be signed in to change notification settings - Fork 71
feat: secondary quick pick for selecting Swift Version with runSwiftScript
command
#1476
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7fb0b88
feat: secondary quick pick for selecting Swift Version with `runSwift…
louisunlimited 698039d
chore: fix spelling
louisunlimited 0cdc25f
feat: add Swift version configuration to package.json
louisunlimited d779f90
feat: add `defaultSwiftVersion` to configuration & reads from `runSwi…
louisunlimited fec0b94
chore: remove extra `script` args in configuration
louisunlimited 49b3131
feat: use markdownDescription in package.json
louisunlimited 00181cc
chore: fix package.json default swift version type & null check
louisunlimited 759e17b
fix: rename `defaultSwiftVersion` to `scriptSwiftLanguageVersion`
louisunlimited a3a5dbf
fix: make picker type `enum`
louisunlimited a477405
chore: make getter default to 6
louisunlimited 9553944
feat: show picker when selected `Ask Every Run`
louisunlimited de87bcf
chore: remove unnecessary markdown description
louisunlimited 8b4bc3c
Merge branch 'swiftlang:main' into main
louisunlimited File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,6 +328,9 @@ const configuration = { | |
.get<string[]>("buildArguments", []) | ||
.map(substituteVariablesInString); | ||
}, | ||
get defaultSwiftVersion(): number | undefined { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type of this setting would also have to change to |
||
return vscode.workspace.getConfiguration("swift").get<number>("defaultSwiftVersion"); | ||
}, | ||
/** swift package arguments */ | ||
get packageArguments(): string[] { | ||
return vscode.workspace | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This setting should be an
enum
type, with the options "6", "5", and "Ask Every Run".enumDescriptions
should be provided for each option as well. I think the default value for the setting should be6
.You can see an example of an
enum
style setting here: https://github.com/swiftlang/vscode-swift/blob/main/package.json#L557. This way the user can't pick an unsupported value, they'll get a warning in the JSON editor and they'll get a nice picker UI in the settings UI page.Also I think the name
defaultSwiftVersion
is too generic and may be confusing. This setting only applies when running Swift scripts but could be interpreted as some kind of global. I'd rename it toscriptSwiftLanguageVersion
.