Skip to content
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

fix: completions for zsh and fish #1912

Merged
merged 4 commits into from
Feb 8, 2025

Conversation

manuraj17
Copy link
Contributor

Summary

Updates completions for fish and shell to use the new commands format without hyphens.

Fixes: #1908

@manuraj17 manuraj17 requested a review from a team as a code owner February 7, 2025 05:01
@manuraj17
Copy link
Contributor Author

manuraj17 commented Feb 7, 2025

Ran into some failures in

./scripts/test.bash

I need to check those, new to the project.

Copy link
Member

@Stratus3D Stratus3D left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @manuraj17 ! I'm going to merge this as it is an improvement. But suggestions for things like asdf plug* don't suggest just asdf plugin but rather all plugin subcommands, which I think is not in line with what most people expect. I'm going to tweak it myself tomorrow and then try to publish a new patch version of asdf.

@Stratus3D Stratus3D merged commit 2f806de into asdf-vm:master Feb 8, 2025
7 checks passed
@Stratus3D Stratus3D mentioned this pull request Feb 8, 2025
@kemko
Copy link

kemko commented Feb 9, 2025

@Stratus3D @manuraj17

complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 58):
complete -f -c asdf -n __fish_asdf_needs_command -a plugin add -d "Add git repo as plugin"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)
complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 64):
complete -f -c asdf -n __fish_asdf_needs_command -a plugin list -d "List installed plugins"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)
complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 67):
complete -f -c asdf -n __fish_asdf_needs_command -a plugin list all -d "List all existing plugins"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)
complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 70):
complete -f -c asdf -n __fish_asdf_needs_command -a plugin remove -d "Remove plugin and package versions"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)
complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 74):
complete -f -c asdf -n __fish_asdf_needs_command -a plugin update -d "Update plugin"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)
complete: too many arguments

/opt/homebrew/share/fish/vendor_completions.d/asdf.fish (line 111):
complete -f -c asdf -n __fish_asdf_needs_command -a list all -d "List all versions of a package"
^
from sourcing file /opt/homebrew/share/fish/vendor_completions.d/asdf.fish
	called on line 29 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
	called during startup

(Type 'help complete' for related documentation)

seems like not tested.

@keldin-coding
Copy link

complete -f -c asdf -n __fish_asdf_needs_command -a 'plugin list all' -d "List all existing plugins"

I was able to "fix" this by wrapping the words passed to the -a argument here in quotes. However, the autocomplete still does not work as I would expect. For example asdf plugin completes, but none of the subcommands of that afterwards.

I would imagine some working with __fish_seen_subcommand_from will have to be used since all the commands have been converted to nested subcommands

@manuraj17
Copy link
Contributor Author

I was travelling when this got merged and I see the issue. It was not tested completely, I was still exploring fish completions and there are some more work. Apologies for the trouble caused.

@manuraj17
Copy link
Contributor Author

Folks, I have made some changes here #1936. I tested it by copying the completions into my fish shell config directory and running it. Let me know if there are still any edge cases. @keldin-coding @kemko

cc @Stratus3D

@Stratus3D
Copy link
Member

Thanks @manuraj17 ! Will test that PR more thoroughly and merge if it looks good 👍

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.

bug: Completions in 0.16.1 still show removed hyphenated commands.
4 participants