trogon
trogon copied to clipboard
Completions when editing values based on Shell Completions
Click Options have a shell_complete kwarg that takes a function that returns a list of completions. It would be helpful if trogon supported running this function by passing in the context and param based similar to how click does so that a dropdown of completions could be shown to pick from.
See Also: Click documentation on how Shell Completions are implemented
I could see this being handled via the existing choices logic within Trogon. But that would make click choices and shell_complete mutually-exclusive in the context of Trogon; i.e., what would Trogon display in the drop-down if both choices and shell_complete were provided?
This is a nice idea - we have the Suggester feature in Textual now too which shows the greyed-out completion text that could be leveraged while implementing this.