This allows you to define custom actions such as run or build and append them to a status bar button in vscode.
You can define a custom action to build a rust project like so.
-
Search for
VsCode Action Buttonsin the extensions store. -
After installing, type
ctrl + shift + pand open up work space settings. -
Now you can define, your action buttons. Below is a sample.
-
Now Reload.
"actionButtons": {
"defaultColor": "#ff0034", // Can also use string color names.
"loadNpmCommands":false, // Disables automatic generation of actions for npm commands.
"reloadButton":"♻️", // Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"commands": [
{
"cwd": "/home/custom_folder", // Terminal initial folder ${workspaceFolder} and os user home as defaults
"name": "Run Cargo",
"color": "green",
"singleInstance": true,
"command": "cargo run ${file}", // This is executed in the terminal.
},
{
"name": "Build Cargo",
"color": "green",
"command": "cargo build ${file}",
}
]
}If you open an existing project and want to set up action buttons for that workspace.
- Define the action buttons in your workspace settings.
- Then, click on
Refresh Action Buttonsin the status bar - You Should now see the action buttons on the status bar :).
Kills the running associated process and restarts it.
"actionButtons": {
"reloadButton": null,
"loadNpmCommands": false,
"commands": [
{
"name": "Run Cargo",
"singleInstance": true,
"color": "#af565c",
"command": "cargo run ${file}",
},
]
}Added support for VSCode predefined variables as ${file}
Added cwd option.
Added reloadButton option.
Added loadNpmCommands option.
Added Refresh Action Buttons action button
Changed configuration name from run to actionButton
Better support for js projects
Added singleInstance option.
Added support for default Colors
Added support for reading actions from the scripts segment of package.json.
Better documentation.
Initial Release
