-
Notifications
You must be signed in to change notification settings - Fork 68
Swift: Run Swift Script
always runs in Swift 5 language mode
#1427
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
Comments
I think a second step would make this feature more cumbersome to use if it had to be picked every time. How about a setting that can be specified globally or per-workspace? |
@plemarquand i did think about that, but i think usually one could just push "return" twice quickly instead of once, to also choose the language mode with the second push? I think VSCode also moves your last-used option to top? A global setting could be fine but then we still should have another command that lets you choose the language mode you'd want, just in case? |
Hi @award999 @MahdiBM @plemarquand , I was browsing over issues and found this. Looks like an interesting addition! Since this is still in Backlog I suppose a nice POC would help visualize this, so I made a tiny PR implementing just be basics of having another dropdown selecting Swift Versions. If this is something y'all would love a PR for I would love to iterate on this and contribute! |
I would prefer a global setting. But the setting could have options swift 6, swift 5 and ask each time. |
Verified in 962681f |
@plemarquand thank you, this looks good enough, but I would have included all swift-supported versions because why not:
if Swift supports these, the official VSCode extension should too, IMO. |
Describe the bug
When running
Swift: Run Swift Script
on single files, the extension runs effectively this command:Since Swift's default language mode is 5, this will be run in Swift 5 language mode.
To fix, the extension should provide a second "step" when you choose
Swift: Run Swift Script
that also asks about what language mode a user would like to choose.Then use that in the command that runs the Swift file. For example the command for Swift 6 language mode would be:
Environment
swift --version
): 6The text was updated successfully, but these errors were encountered: