Salesforcedx-vscode: In VSCode is it possible to make SFDX Retrieve Source From Org confirm before proceeding?

Created on 5 Jun 2019  路  1Comment  路  Source: forcedotcom/salesforcedx-vscode

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?

deploretrieve feedback

Most helpful comment

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 think add a keybinding for ease of use:

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

>All comments

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 think add a keybinding for ease of use:

    {
        "key": "shift+cmd+r",
        "command": "workbench.action.tasks.runTask",
        "args": "refreshFile",
        "when": "editorTextFocus && editorLangId == 'apex'"
    }
Was this page helpful?
0 / 5 - 0 ratings