Open Minipada opened 2 years ago
having a similar weird issue where autocompletion is working fine in bash/osx, but in pwsh/win11 some of my autocomplete works, but others fail in the same script.
For example using def hi(name: List[str] = typer.Argument(..., autocompletion=something)): ...
works fine to suggest completions starting from empty name
or partial string, but if I drop the List
and do def hi(name: str = typer.Argument(..., autocompletion=something)): ...
then I get autocomplete suggestions if I [tab][tab] from an empty argument, but as soon as I have one or more characters incomplete string then [tab][tab] gives nothing and apparently my callback something
isn't even called.
Tried various combinations of typer/click version but can't find a clue yet.
btw in your example you're using autocompletion
rather than callback
for typer?
First Check
Commit to Help
Example Code
Description
On VSCode, I don't have autocompletion for the context in a callback. I am not sure where it comes from but this definitely seems a typer issue since it is working with Click.
I added both in the example.
EDIT: I am here trying to get other options from this callback.
Operating System
Linux
Operating System Details
NAME="Manjaro Linux" ID=manjaro ID_LIKE=arch BUILD_ID=rolling PRETTY_NAME="Manjaro Linux" ANSI_COLOR="32;1;24;144;200" HOME_URL="https://manjaro.org/" DOCUMENTATION_URL="https://wiki.manjaro.org/" SUPPORT_URL="https://manjaro.org/" BUG_REPORT_URL="https://bugs.manjaro.org/" LOGO=manjarolinux
Typer Version
0.4.0
Python Version
3.9.9
Additional Context
No response