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
ZSH Completion Script incorrect #5789
Comments
@bitjammer is this something you are familiar with? |
We're just calling |
If you could reduce this to a small reproducer and open an issue in apple/swift-argument-parser we can take a look! |
It appears that using an empty string as a value for
In my small reproducer (https://github.com/MarcoEidinger/spm-issue-5789-repo) I find no issues when using @rauhul please advise if you see this as issue for apple/swift-argument-parser and I should create an issue there OR if you think that SPM shall change their implementation FYI @neonichu |
Looks like a sap bug imo, though the quick solution for spm is changing the default to nil. I can probably fix the sap issue tomorrow morning, but filing an issue would be good regardless! Thanks a ton for tracking down the bug 💛 |
I created PR to change SPM for an easy solution. SPM is using swift-argument-parser@1.0.3 @rauhul further testing reveals that this particular issue is solved in swift-argument-parser@1.1.4 due to apple/swift-argument-parser#443 which filters out subcommands that shall not be displayed which would be the case for SPM's extension SwiftPackageTool {
// This command is the default when no other subcommand is passed. It is not shown in the help and is never invoked directly.
struct DefaultCommand: SwiftCommand {
static let configuration = CommandConfiguration(
commandName: "",
shouldDisplay: false) // <====!!!!!!!!!!!
}
}
} Hence I won't file an issue in swift-argument-parser |
I think this is still reveals a bug in sap as we should never generate illegal completion scripts. |
Description
Trying to use auto-completion for
swift package
(or other SwiftPM commands) relying on completion script generated withswift package completion-tool generate-zsh-script
Expected behavior
Code completion appears
Actual behavior
Getting parsing error when trying code completion
Steps to reproduce
Run the commands as noted in https://github.com/apple/swift-package-manager/blob/main/Documentation/Usage.md#using-shell-completion-scripts
Then open new terminal and try auto-complete (
TAB
) forswift package
Swift Package Manager version/commit hash
Swift 5.6.1 (Xcode 13.4.1)
Swift & OS version (output of
swift --version && uname -a
)swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: arm64-apple-macosx12.0
The text was updated successfully, but these errors were encountered: