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

commands order not always working well #41

Open
kobi2187 opened this issue Oct 10, 2018 · 3 comments
Open

commands order not always working well #41

kobi2187 opened this issue Oct 10, 2018 · 3 comments

Comments

@kobi2187
Copy link

I have mixed results with a macro I am using.
I am using both the current find widget, and the search files panel.
activating the next match, and then the find widget.
But sometimes the find widget executes before the search match.
At least, that's what I deem is happening...
Are the commands happening one after another? Can it be an async problem?
Is there a way that I can add a little delay (sleep?), or wait for focus?
If there is a better way to contact and debug this together, please let me know.

@leetschau
Copy link

I face the same problem:

      "runHaskellCode": [
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": ":{" }
        },
        "workbench.action.terminal.runSelectedText",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": ":}" }
        }
      ]

The text received by the terminal is:

:{:} // the text selected

But what I want is:

:{
// the text selected
:}

@rsxdalv
Copy link

rsxdalv commented Oct 26, 2018

This is caused by delay in the editor, to verify it you can add a bunch of write commands (and you'll see that they eventually write in the find window)

Solution: #13

@steelcracker
Copy link

Stumbled upon this too.
Downloaded the extension and started to write a heavy macro and right from the start this order thing happened. Here is the example:

"refactorExtractLocaleString": [
    "editor.action.smartSelect.grow",
    "editor.action.smartSelect.grow",
    "editor.action.clipboardCopyAction",
    //{"command": "type", "args": {"text": "["}}
]

This should select a string literal surrounded with quotes and copy it to the clipboard. But CopyAction runs before selection and copies the entire line. The next thing I was going to add was a keypress action to surround the literal with brackets which also didn't work as expected..

#11 solved the issue

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

No branches or pull requests

4 participants