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

Command line completion on MacOS and Oh-my-Zsh broken #477

Open
romixch opened this issue Jun 24, 2022 · 5 comments
Open

Command line completion on MacOS and Oh-my-Zsh broken #477

romixch opened this issue Jun 24, 2022 · 5 comments

Comments

@romixch
Copy link

romixch commented Jun 24, 2022

I love Watson! But since I upgraded to version 2.1 my command line completion does not work.

I installed it with brew install watson
Uninstall and reinstall did not help.
I extended my .zshrc with autoload -Uz compinit && compinit
rm "$ZSH_COMPDUMP" did not help.
Code completion for other command line tools do work.

Further information:

$ ls -lah /usr/local/share/zsh/site-functions
total 0
drwxr-xr-x  8 roman  admin   256B 24 Jun 11:32 .
drwxr-xr-x  3 roman  admin    96B  9 Okt  2019 ..
lrwxr-xr-x  1 roman  admin    39B  9 Okt  2019 _brew -> ../../../Homebrew/completions/zsh/_brew
lrwxr-xr-x  1 roman  admin    88B 15 Jan  2021 _brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services
lrwxr-xr-x  1 roman  admin    60B 23 Jun 21:39 _meson -> ../../../Cellar/meson/0.62.2/share/zsh/site-functions/_meson
lrwxr-xr-x  1 roman  admin    66B 24 Jun 08:27 _minikube -> ../../../Cellar/minikube/1.26.0/share/zsh/site-functions/_minikube
lrwxr-xr-x  1 roman  admin    60B 23 Jun 21:38 _ninja -> ../../../Cellar/ninja/1.11.0/share/zsh/site-functions/_ninja
lrwxr-xr-x  1 roman  admin    61B 24 Jun 11:32 _watson -> ../../../Cellar/watson/2.1.0/share/zsh/site-functions/_watson

$ watson --version
Watson, version 2.1.0

$ python --version
Python 2.7.18

$ python3 --version
Python 3.8.9

$ zsh --version
zsh 5.8.1 (x86_64-apple-darwin21.0)

I am stuck right now. I can't find any error message. I just got the system bell. Command line completion is pretty essential to me.

@mrpsharp
Copy link

I have the same issue. I think it is what PR #473 refers to.

@romixch
Copy link
Author

romixch commented Jun 27, 2022

Pretty sure this is a duplicate of the PR #473.

@romixch romixch closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
@romixch
Copy link
Author

romixch commented Jul 5, 2022

I reopen this bug because I can only find a pull request but no bug to it. Unfortunately there is nothing going on here since the release of version 2.1.0. The last commit was on may 16. Does anybody know why?
If there was at least an easy workaround to install the old version 2.0.1.

@romixch romixch reopened this Jul 5, 2022
@capital-G
Copy link

Switching to 2.0.1 via

 pip3 install --upgrade git+https://github.com/TailorDev/Watson.git@2.0.1

does not help, but at least it shows an error when you try to autocomplete via zsh

watson
Traceback (most recent call last):
  File "/usr/local/bin/watson", line 5, in <module>
    from watson.__main__ import cli
  File "/usr/local/lib/python3.10/site-packages/watson/__main__.py", line 1, in <module>
    from watson import cli
  File "/usr/local/lib/python3.10/site-packages/watson/cli.py", line 215, in <module>
    def start(ctx, watson, confirm_new_project, confirm_new_tag, args, at_,
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 287, in decorator
    _param_memo(f, ArgumentClass(param_decls, **attrs))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2950, in __init__
    super().__init__(param_decls, required=required, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'
Traceback (most recent call last):
  File "/usr/local/bin/watson", line 5, in <module>
    from watson.__main__ import cli
  File "/usr/local/lib/python3.10/site-packages/watson/__main__.py", line 1, in <module>
    from watson import cli
  File "/usr/local/lib/python3.10/site-packages/watson/cli.py", line 215, in <module>
    def start(ctx, watson, confirm_new_project, confirm_new_tag, args, at_,
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 287, in decorator
    _param_memo(f, ArgumentClass(param_decls, **attrs))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2950, in __init__
    super().__init__(param_decls, required=required, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'
Traceback (most recent call last):
  File "/usr/local/bin/watson", line 5, in <module>
    from watson.__main__ import cli
  File "/usr/local/lib/python3.10/site-packages/watson/__main__.py", line 1, in <module>
    from watson import cli
  File "/usr/local/lib/python3.10/site-packages/watson/cli.py", line 215, in <module>
    def start(ctx, watson, confirm_new_project, confirm_new_tag, args, at_,
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 287, in decorator
    _param_memo(f, ArgumentClass(param_decls, **attrs))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2950, in __init__
    super().__init__(param_decls, required=required, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'
Traceback (most recent call last):
  File "/usr/local/bin/watson", line 5, in <module>
    from watson.__main__ import cli
  File "/usr/local/lib/python3.10/site-packages/watson/__main__.py", line 1, in <module>
    from watson import cli
  File "/usr/local/lib/python3.10/site-packages/watson/cli.py", line 215, in <module>
    def start(ctx, watson, confirm_new_project, confirm_new_tag, args, at_,
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 287, in decorator
    _param_memo(f, ArgumentClass(param_decls, **attrs))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2950, in __init__
    super().__init__(param_decls, required=required, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'
Traceback (most recent call last):
  File "/usr/local/bin/watson", line 5, in <module>
    from watson.__main__ import cli
  File "/usr/local/lib/python3.10/site-packages/watson/__main__.py", line 1, in <module>
    from watson import cli
  File "/usr/local/lib/python3.10/site-packages/watson/cli.py", line 215, in <module>
    def start(ctx, watson, confirm_new_project, confirm_new_tag, args, at_,
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 287, in decorator
    _param_memo(f, ArgumentClass(param_decls, **attrs))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 2950, in __init__
    super().__init__(param_decls, required=required, **attrs)
TypeError: Parameter.__init__() got an unexpected keyword argument 'autocompletion'

Also switching to the PR branch via

pip3 install --upgrade git+https://github.com/voidus/Watson.git@fix-completions

did not fix this issue for me as well ;/

@Kai-Hei
Copy link

Kai-Hei commented Sep 30, 2022

I had the same issue the other day (macOS / brew install watson)

I patched /usr/local/Cellar/watson/2.1.0/libexec/lib/python3.10/site-packages/watson/autocompletion.py
$ cd /usr/local/Cellar/watson/2.1.0/libexec/lib/python3.10/site-packages
$ patch watson/autocompletion.py ~/Downloads/quickfix_autocomplete_on_macOS.patch.txt

Then I replaced /usr/local/Cellar/watson/2.1.0/share/zsh/site-functions/_watson calling
$ _WATSON_COMPLETE=zsh_source watson > /usr/local/Cellar/watson/2.1.0/share/zsh/site-functions/_watson
(it's zsh_source, not source_zsh)

Check using echo $fpath that /usr/local/share/zsh/site-functions is in the search path for function definitions.

Seems to work for me, now.

quickfix_autocomplete_on_macOS.patch.txt

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

No branches or pull requests

4 participants