6

I'd like VSCode to confirm with me when I run command:

SFDX Retrieve Source From Org

Before proceeding, because I regularly select the wrong option when right clicking.

Is there a setting or option to enable this?

6

There is no confirm prompt currently provided .

I would suggest you can open a feature request on the repository here

3

Kudos to Charlie Jonas for responding to my github issue and suggesting this:

As a workaround you could write your own task to do this (and pretty much the rest of this extension). Would look something like this:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "refreshFile",
            "type": "shell",
            "command": " if [ \"${input:confirm}\" != \"yes\" ]; then exit 1; fi && sfdx force:source:retrieve -p ${file}",
            "problemMatcher": []
        },
    ],
    "inputs": [
        {
            "type": "pickString",
            "id": "confirm",
            "description": "Are you sure you want to refresh?",
            "options": ["yes", "no"],
            "default": "no"
        },
    ]
}

you could add a keybinding for ease of use:

{
    "key": "shift+cmd+r",
    "command": "workbench.action.tasks.runTask",
    "args": "refreshFile",
    "when": "editorTextFocus && editorLangId == 'apex'"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.