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
Argparser auto-completion and colored help #4267
Conversation
3d3e8c3
to
5558cc0
Compare
added motivation here #4284 |
Hey @jnoortheen - can you explain a bit which improvements this PR does? It's a bit hard to get from the code |
It generates |
AFAIK all of xonsh's requirements need to be optional |
Yes I was also hesitant adding another dependency. But this comes from Python core repo. Also I dont find any other way to pass the metadata that passes type-checker. |
Since the type checker only runs in the CI, you can use this package and add it to the dev requirements file with a fallback to Any on import error. We don't really need the annotations in production anyway |
Ok that is better. |
02c4cf0
to
9d5144b
Compare
dad2efd
to
32fd260
Compare
Codecov Report
@@ Coverage Diff @@
## main #4267 +/- ##
==========================================
+ Coverage 57.13% 57.44% +0.31%
==========================================
Files 138 136 -2
Lines 22178 22243 +65
Branches 4068 4096 +28
==========================================
+ Hits 12671 12778 +107
+ Misses 8454 8394 -60
- Partials 1053 1071 +18
Continue to review full report at Codecov.
|
32fd260
to
8e50d36
Compare
d57815d
to
dcec572
Compare
09ce721
to
1810b1d
Compare
see discussion on xonsh#4267
see discussion on xonsh#4267
see discussion on xonsh#4267
see discussion on xonsh#4267
see discussion on xonsh#4267
see discussion on xonsh#4267
@daniel-shimon are there any other things to check? |
* feat: add colored help formatter and alias builder closes #4284 * feat: add auto-completion support to argparser * test: update test for completer * fix: getting doc from params that have annotation * refactor: use filter-function for checking alias completions * doc: add discussion abount check for alias having parser see discussion on #4267 * type fix * refactor: use function based completer * test: fix failing argparser test * docs: update news item * update completion for argparser sub-commands to append_space from comment on #4267 (comment) * docs: update docstring typo * refactor: move inspect import to top * feat: support option strings before positionals and add env setting for showing completions for options by default * test: update tests after adding new $ALIAS_COMPLETIONS_OPTIONS_BY_DEFAULT * add suggested completion_context_parse fixture * docs: add suggested doc for dispatch function * refactor: use try/except for import of typing.annotated * refactor: move complete_argparser_aliases to completers/aliases.py * refactor: move argparser completer to its own module * style: * refactor: rename completer to not clash with argparse * fix: expand option's descriptions * fix: add completer/argparser to amalgam
@anki-code this PR is outdated. I will close it after the related PRs get closed. please check the one in here #4437 |
see discussion on xonsh#4267
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
this will resolve checking parser or alias. Now the alias can define how it completes. will solve xonsh#4267 (comment)
* feat: create field to define alias-completer this will resolve checking parser or alias. Now the alias can define how it completes. will solve #4267 (comment) * docs: * fix: mypy error * fix: rst qa * style:
TODO:
sub PRs:
I think it is better to split this PR
For community
⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment