-
Notifications
You must be signed in to change notification settings - Fork 78
click experiment: demo for autocompletion #245
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
base: feature/metamodel_parameters_issue240
Are you sure you want to change the base?
click experiment: demo for autocompletion #245
Conversation
… 'check') -- see code
@goto40 This looks cool. Great idea! |
Autocompletition works great for options integrated with decorators (as we do in textX). E.g.,--language automatically provides all available languages (this feels great). However I did not manage, so far, to dynamically add an option (based on the language). Maybe I have to investigate further. So far, I provided an option to specify a param: - - x paramname=value |
The - - x option autocompletes, based on the selected language. |
@goto40 I've been playing today with this feature. One observation is that while we get autocompletion on textX languages and options, which is great, we loose completion on file names (e.g. calling BTW, this is probably not a problem of Click but the way shell completion works. |
I would really like to be able to filter/extend list of options for a particular command. This would enable to extend the list if a language is given thus eliminating the need to remember that you need to type |
So you would like to dynamically add I will further try to play with click.. if you find something you can comment here. |
(I accidentally did some refactorings in this branch - this should not hurt - this is a playground only) |
This PR represents an experiment how to integrate click completition (for the kwargs PR). I extended the types-dsl language to have an extra kwargs option.
Preparation
Run in your virtualenv (I use a bash)
Demo
Then, you can do
textx <TAB> <TAB>
to get cool autocompletions... (it allows to select a language fortextx check --language ...
and also one optional kwargs value):Of course we will also provide some "list-all-possible-options..."...
Open for discussion!
Code review checklist
CHANGELOG.md
, no needto update for typo fixes and such).