Visual Studio Code actions
Visual Studio Code actions are used to perform actions related to Visual Studio Code in the editor. You can use these actions to execute commands, show information messages, and more.
Execute a Visual Studio Code command
Execute a Visual Studio Code command using the executeVSCodeCommand
action.
{ "action": "executeVSCodeCommand", "command": "<command to execute>", "args": "<arguments to pass to the command (optional)>", "path": "<relative path to the file (optional, when defined, the args property is ignored.)>"}
How to find the command to execute
You can find the command to execute by opening the command palette in Visual Studio Code (Ctrl+Shift+P or Cmd+Shift+P) and typing the command you want to execute. The command palette will show you the available commands that match your search query.

Next to the command, you can see the “gear” icon. When you click on this icon, you get redirected to the keyboard shortcuts page where you can right-click on the command and select “Copy Command ID” to copy the command ID.

Show an information message
Show an information message in Visual Studio Code using the showInfoMessage
action.
{ "action": "showInfoMessage", "message": "<message>"}
Set state
The setState
action allows you to set a key/value pair in the extension state which can be accessed by other actions. You can use the state value in your demo steps by using the following {STATE_<key>}
syntax.
{ "action": "setState", "state": { "key": "<key>", "value": "<value>" }}
Store the clipboard content in the extension state
For example, you could use this action in combination with the {DT_CLIPBOARD}
variable to store the clipboard content in the extension state and then use it in another action.
{ "action": "setState", "state": { "key": "resourceID", "value": "{DT_CLIPBOARD}" }}
To use the stored value in another action, you can reference it using the {STATE_<key>}
syntax.
{ "action": "create", "path": "sample.json", "content": "{\n \"firstName\": \"{STATE_resourceID}\"\n}"}
Open a website
Open a website in your browser or in the editor using the openWebsite
action.
{ "action": "openWebsite", "url": "<URL>", "openInVSCode": "<true/false>"}