-
Notifications
You must be signed in to change notification settings - Fork 773
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
Created a centralized please command #1537
base: main
Are you sure you want to change the base?
Conversation
I was able to test this in VSCode and jet brains on the mac but I was unable to test the other implementations to make sure they're working. I could use a hand with testing on other platforms to make sure these things still work, though the implementations appear correct to me right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to use a tag for this to avoid "promising what we can't deliver". With the exception of the tiny nit I mentioned, the only other thing I can think that might is whether we'd like to continue sending an empty string for "please" by itself or define two voice commands and an action with an optional argument. I don't feel strongly one way or the other.
apps/arc/arc.py
Outdated
@@ -20,6 +20,11 @@ def tab_close_wrapper(): | |||
actions.sleep("180ms") | |||
actions.app.tab_close() | |||
|
|||
def please_command(command: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to call this command_search
instead. Also the argument should probably be optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to do this but I'm not sure if I did it right. Please check my work-thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there is a discussion if we want to default to an empty string or None.
def draft_show(text: Optional[str] = None): |
Also I personally feel that if the argument is optional we should do an if statement an only do sleep and insert if we actually have an argument.
https://github.com/AndreasArvidsson/andreas-talon/blob/114911424dc568d833b865f64f8607ac83275a6d/apps/vscode/vscode_git.py#L63-L67
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When calling the action from talon script, you still need to pass the argument (I.e. arg or ""), right? Otherwise you'll get an error, I think. Unless there's some way I don't know about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not of its optional. You just need to do it that way I linked above, but you need to call it from a separate command. (arg)
doesn't work if arg
is optional. You call it without any argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through and added the conditions. Do you think I should add the separate command? I wasn't sure about that.
To avoid divergence in the grammar for please commands, it is useful to define a centralized tag and allow it to be overridden in command implementations.
- It looks like the formatting was more than just adding a comma ; this should be cleaner now
3750d85
to
1a17a4c
Compare
- Only insert text if it was searched for
To avoid divergence in the grammar for please commands, it is useful to define a centralized tag and allow it to be overridden in command implementations.
Addresses #1536