Search code examples
visual-studio-codesaveworkspace

Visual Studio Code Run On Save Extension not running


I installed the Run On Save extension for VS Code. I made a Workspace setting for it, and if I change a file then resave, it does not seem to run. "I run for all files" does not show up in the console or terminal.

When I chose to edit the command configuration in my Workspace settings, it automatically edited the file with the comment "Place your settings in this file to overwrite default and user settings." so it looks like this:

// Place your settings in this file to overwrite default and user settings.
{
    "editor.mouseWheelZoom": false,
    "emeraldwalk.runonsave": {
        "commands": [
            {
                "match": ".*",
                "isAsync": true,
                "cmd": "echo 'I run for all files'"
            }
        ]
    }
}

I'm new to configuring Workspace settings, so I'm not sure if this is okay or not. I ensured that Run On Save is enabled by selecting it on the command palette.

Here is the site for the extension: https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave


Solution

  • I had the exact same issue. I removed that extension and am using this one instead:

    https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run

    It is a fork based on RunOnSave. This one works for me when I set its configuration in my user settings and then run the command "Save and Run: Enable".

    This one uses the bulit-in powershell terminal.

    HTH