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

[repl] Actions tab completion should work #143

Closed
hunner opened this issue Jan 21, 2020 · 4 comments
Closed

[repl] Actions tab completion should work #143

hunner opened this issue Jan 21, 2020 · 4 comments
Milestone

Comments

@hunner
Copy link

hunner commented Jan 21, 2020

What happens:
Opening the repl and typing talon.actions.<tab> only tab-completes talon.actions.registry.

What should happen:
All of the actions should be listed, such as talon.actions.key and talon.actions.insert

Motivation:
Actions are the building-blocks of talon files, and discovery is important to adoption.

@lunixbochs
Copy link

What if for now I just make actions.registry not tab-completable, and make actions. give you something like actions.list(), that pretty prints them all

@hunner
Copy link
Author

hunner commented Jan 21, 2020

It seems like anything that is in the python public-api should be tab completable if possible, whether they are methods or classes. Talon actions appear to be dynamically-registered function namespaces that are constructed separately from the python class structure and are meant to be called as talon commands, not via python scripts directly.

Maybe the intended interaction from the repl is not self-evident. Under talon.actions.registry.actions all the actions are visible, but talon.actions.registry overlaps with the talon.actions.* namespace that actions are "registered" into.

What if the registry was moved to talon.actions_registry and talon.actions.* was purely just for registered actions? That would make the python -> action interface fairly uniform, and nothing would overlap (say if I registered an action called registry.actions).

@lunixbochs
Copy link

lunixbochs commented Jan 21, 2020

I did my list() solution in the latest release.

The repl is for experimentation, not really for documentation. In the future there will be a significantly better form of auto-documentation for stuff like actions that will also be easily accessible to people who aren't comfortable with Python.

actions.X does not work like you think it does at all, which makes it difficult to tab complete at the moment, sorry. It's not a static interface, the actual actions aren't and cannot be real properties on it, and the repl's autocompletion is a black box handled by python's rlcompleter.

The actions.registry property wasn't intended to be a public property people would actually use, it's just an implementation detail and is hidden now.

Small note, you can access e.g. actions directly in the repl with no import. No need to do talon.actions

@lunixbochs lunixbochs transferred this issue from talonvoice/beta Nov 2, 2020
@lunixbochs lunixbochs added this to the v1.0.0 milestone Jan 27, 2021
@lunixbochs
Copy link

fixed in beta v0.1.5-433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants