Home > Software design >  VS Code keybinding: Accept quickfix codeAction
VS Code keybinding: Accept quickfix codeAction

Time:09-18

I'm trying to implement a small function by adding a shortcut for auto-correcting the last misspelled word, and this is what I get currently:

{
    "key": "cmd l",
    "command": "extension.multiCommand.execute",
    "args": {
        "sequence": [
            "cSpell.goToPreviousSpellingIssue",
            "editor.action.quickFix",
            "workbench.action.navigateToLastEditLocation",
            "acceptSelectedSuggestionOnEnter",
            "acceptSelectedSuggestion"
        ]
    }
},

The idea is simple: jump back to the first misspelled word, and just select the first suggestion my spelling checker gives me, finally jump back to the previous edited position.

The code above is using multiCommand plug-in. Question is that I can't find any keystroke events to let me actually select the first suggestion my spelling checker gives me. As in the config, I'm using cSpell for checking my spelling. To be specific, after I hit cmd l, this is what I get: code action in a command demo

  • Related