Closed kastiglione closed 1 year ago
I can look into that, maybe the commit messages as well. I don't remember exactly but I believe that was required for something...
The closest thing that appears to be related, but not quite the same is: 0ae37347c55c96b83bc820a6766200547450ff60. It seems all files have had a single space message from the start.
Interesting, as long as all the mentioned combinations worked it should be fine. I remember at some point there being an issue with the cases of:
1) xcodebuild ACTION -<TAB>
2) xcodebuild -<TAB> AC<TAB>
3) xcodebuild -arg ACTION -<TAB>
As long as those still work without that space then we're good!
According to man zshcompsys
, there are three forms:
*:message:action
*::message:action
*:::message:action
and so *::->actions
is perhaps being interpreted as the second with a message of "->actions".
Which puts me back to the start, getting bad completion for -
options.
Hmm. I wonder if the original issue you mention here of getting so many lines is caused by that, or a config issue on one of our sides. Here's what I get:
I'll move my config files aside and try with defaults.
This line in my .zshrc
is part of the problem:
zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]}'
This is added by compinstall
. I don't do any other customization, it's just this one line, which allows lower-to-upper matching when doing completion. I have no idea why these two things would conflict.
Interesting. I don't either. Does the change your suggesting have any negative effects though? Because if it doesn't we could definitely merge it regardless.
Yeah, it made autocomplete half broken. I'm hoping to play around with this more over time to figure out a working fix.
Let me know what you find!
@keith I did try out your completions for the first time today and ran into similar issues, mainly when providing a single hyphen Zsh provided me with 186 completions, which were made up of:
n
argumentI dug into the script and found that the correct way to offer completion for the actions as well as correct completion of all arguments even with complex completion setups is to call the _actions
function directly and not use a state switch:
_arguments \
[...]
':*:Build actions:_actions
I gleaned this from other Zsh completions and at least in my tests it fixed all my issues:
-n
and -dry-run
are correctly groupedI dunno if the position in the _arguments
call is of significance, but I moved it to the bottom of the call for now.
def happy to take PRs, I haven't debugged this in a while 😕
def happy to take PRs, I haven't debugged this in a while 😕
Opened https://github.com/keith/zsh-xcode-completions/pull/16 to fix this.
Thanks!
In this project, the
_arguments
function is generally given an argument completion in the form of:Why is the message a single space?
Currently, when I do
xcodebuild -<TAB>
, I get 162 lines of output. The output consists of all options, plus their descriptions being listed on their own line with a--
prefix, plus a bunch of blank lines, and all of this gets repeated three times.When I changed this line of
_xcodebuild
to:the use of an empty message, instead of one space, caused the tab completion of
-
options to work as expected.I'm using zsh version 5.0.5.