Skip to content

Run from Visual Studio Code

An open VoltScript file can be run from the Command Palette, VoltScript: Save & Run Script. The standard VS Code keyboard shortcuts (Cmd + F5 / Ctrl + F5) will also work. An input box will be displayed to add any additional runtime parameters. For additional parameters, see runtime options.

You can also debug code. This can be done by creating a Run / Debug configuration in a launch.json file, using standard VS Code functionality. If you have a .vss file open, the run / debug configuration created will automatically be for VoltScript. Otherwise, you will be prompted to choose the language. The file will be created as launch.json in a .vscode directory. The content will default to:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "voltscript",
            "name": "VoltScript - Launch",
            "request": "launch",
            "pathToScript": "${file}",
            "scriptContext": "",
            "setiPath": "${workspaceFolder}/seti.ini",
            "stopAtEntry": true
        }
    ]
}

This will run the open script file ("pathToScript": "${file}") breaking on the first line ("stopAtEntry": true). To just run the code without debugging, change stopAtEntry to false.

You can pass contextual data by pasting it into scriptContext, escaping any double quotes as required. This can be picked up with ContextVSE, see Receive input.

Preview

Debug is provided as a preview capability only.