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

Dynamic Macro #125

Closed
tshino opened this issue Jul 3, 2022 · 3 comments
Closed

Dynamic Macro #125

tshino opened this issue Jul 3, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@tshino
Copy link
Owner

tshino commented Jul 3, 2022

I've been asked if it is possible to implement Dynamic Macro on VS Code by its inventor @masui.

Dynamic Macro is a clever technique to perform repetitive operations.
See the paper (CHI 1994) for the details.

My understanding is that:
with Dynamic Macro, it doesn't require users to declare to start recording and to stop recording, instead, requires just to request to repeat the sequence the user has just repeated right before.

In order to implement it, the mechanism to record the keyboard inputs has to be always active rather than only during recording.
It means the wrapper keybindings is going to be used always.
This will be a big change to the internal behavior of this extension.

So, I think it is better to be an opt-in feature if implemented in this extension.

I will investigate further design impact and implementation.

@tshino tshino added the enhancement New feature or request label Jul 3, 2022
@tshino
Copy link
Owner Author

tshino commented Jul 18, 2022

One obvious design change needed for this feature is changing the condition to activate the wrapper keybindings.
Specifically, the context used in the condition has to be changed from kb-macro.recording to a different one.
At this moment, candidates of the name for the new context include kb-macro.active, kb-macro.monitoring, kb-macro.listening.

This:

    {
        "key": "ctrl+shift+a",
        "command": "kb-macro.wrap",
        "args": {
            "command": "editor.action.selectToBracket"
        },
        "when": "kb-macro.recording && editorTextFocus" // LOOK AT THIS LINE!
    }

has to be changed to something like:

    {
        "key": "ctrl+shift+a",
        "command": "kb-macro.wrap",
        "args": {
            "command": "editor.action.selectToBracket"
        },
        "when": "kb-macro.active && editorTextFocus" // LOOK AT THIS LINE!
    }

.

This requires existing users to manually modify their keybindings.json if they want to enable the new DynamicMacro feature.

@tshino tshino mentioned this issue Aug 1, 2022
8 tasks
This was referenced Dec 27, 2022
@tshino
Copy link
Owner Author

tshino commented Jan 9, 2023

I have started the implementation of this new feature as a separate vscode extension in separate repository:
https://github.com/tshino/vscode-dynamic-macro

The new extension Dynamic Macro declares dependency to this extension in its extension manifest (extensionDependencies in package.json) so that it can access APIs provided by this extension.

@tshino
Copy link
Owner Author

tshino commented Jan 16, 2023

Finally, the new version of this extension has been released!
https://github.com/tshino/vscode-kb-macro/releases/tag/v0.13.0

It includes brand new functionality Background Recording API that makes it possible to create keystroke automation extensions using this extension's capabilities.
There were a lot of design decisions and implementations with careful tests.
The new extension Dynamic Macro, which is the purpose of this big new feature of this extension, now can work with the released version of this extension and will be ready to be published.

@tshino tshino closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant