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

Second command of macro no longer executed after recent VS Code update #45

Open
percygrunwald opened this issue Dec 20, 2018 · 3 comments

Comments

@percygrunwald
Copy link

Env

Mac OS 10.13.6 (17G3025)
VS Code Version 1.30.1 (1.30.1)
Macros v1.2.1

Diagnosis and steps to reproduce

I use the macros plugin to replicate the cmd+e behavior of IntelliJ for Mac. This command opens the "Recent files" dialogue and shifts the cursor to the previously open file (i.e. the second item in the list of recently opened files, where the currently open file is first on the list).

To do this in VS Code, I created this macro:

    // User Setings
    ...
    "macros": {
        "intellijRecent": [
            "workbench.action.quickOpen",
            "workbench.action.quickOpenNavigateNext",
        ]
    },
    ...

And bound it to cmd+e in my keybindings:

    // keybindings.json
    ...
    {
        "key": "cmd+e",
        "command": "macros.intellijRecent",
        "when": "!inQuickOpen"
    },
    ...

Up until today, this was working as expected: pressing cmd+e would open the recently open files dialogue box and move the cursor to the second item in the list. Today, it is opening the recently open files dialogue box, but not moving the cursor to the second item in the list.

I tried these changes to see if they would return the expected behavior, but they did not:

    "macros": {
        "intellijRecent": [
            "workbench.action.quickOpen",
            "workbench.action.quickOpenNavigateNext",
            "workbench.action.quickOpenNavigateNext"
        ]
    },
    "macros": {
        "intellijRecent": [
            "workbench.action.quickOpen",
            "workbench.action.quickOpenNavigateNextInFilePicker"
        ]
    },
    "macros": {
        "intellijRecent": [
            "workbench.action.quickOpen",
            "workbench.action.quickOpenNavigateNextInRecentFilesPicker"
        ]
    },

It seems to me that the second command is not being executed in the new update for some reason.

Any advice about trying to determine the cause of the issue would be greatly appreciated. Thank you!

@percygrunwald
Copy link
Author

Might be related to #29, but my example was definitely working up until I opened VS Code today.

@percygrunwald
Copy link
Author

Comment on the issue at the VSCode repo: microsoft/vscode#65443 (comment)

This is an issue with the extension. The promises returned by executeCommand are not properly waited upon here. It is a coincidence that this ever worked (due to the winjs promise implementation we used before).

@ctf0
Copy link

ctf0 commented May 11, 2019

what u need is #13

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

2 participants