### Full-Stack Development Configuration Example Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Provides a comprehensive configuration example for a full-stack JavaScript/TypeScript project, including commands for frontend, backend, database, testing, and build processes. It demonstrates advanced options like `singleInstance`, `cwd`, and `saveAll`. ```json { "actionButtons": { "defaultColor": "#61dafb", "reloadButton": "$(refresh)", "loadNpmCommands": false, "commands": [ { "name": "$(server) API", "command": "npm run server", "color": "#68d391", "singleInstance": true, "cwd": "${workspaceFolder}/backend", "tooltip": "Start Express API server" }, { "name": "$(browser) Frontend", "command": "npm run dev", "color": "#61dafb", "singleInstance": true, "cwd": "${workspaceFolder}/frontend", "tooltip": "Start React development server" }, { "name": "$(database) DB", "command": "docker-compose up -d postgres", "color": "#336791", "singleInstance": true, "tooltip": "Start PostgreSQL container" }, { "name": "$(beaker) Test", "command": "npm test -- --watch ${relativeFile}", "color": "#f6e05e", "saveAll": true, "tooltip": "Run tests for current file" }, { "name": "$(tools) Build", "command": "npm run build", "color": "#fc8181", "saveAll": true, "tooltip": "Production build" }, { "name": "$(git-commit) Format", "useVsCodeApi": true, "command": "editor.action.formatDocument", "color": "#b794f4", "tooltip": "Format current document" } ] } } ``` -------------------------------- ### Dynamic Command Construction with Variables Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Demonstrates how to use VS Code predefined variables within command strings to create dynamic actions. These variables allow commands to adapt based on the current file, workspace, and editor state. ```json { "actionButtons": { "commands": [ { "name": "Run Current File", "command": "node ${file}", "tooltip": "Executes the currently open file with Node.js" }, { "name": "Test Current", "command": "npm test -- ${relativeFile}", "tooltip": "Run tests for current file" }, { "name": "Copy Path", "command": "echo ${workspaceFolder}/${relativeFile}", "tooltip": "Print full path of current file" }, { "name": "Compile to Output", "command": "tsc ${file} --outDir ${workspaceFolder}/dist", "tooltip": "Compile TypeScript file to dist folder" }, { "name": "Run at Line", "command": "python -c \"exec(open('${file}').read().split('\n')[${lineNumber}-1])\"", "tooltip": "Execute Python code at current line" }, { "name": "Search Selected", "command": "grep -r '${selectedText}' ${workspaceFolder}", "tooltip": "Search for selected text in workspace" } ] } } ``` -------------------------------- ### Define Custom Action Buttons Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Demonstrates how to define specific commands with custom names and colors. This configuration allows for both shell commands and npm scripts. ```json { "actionButtons": { "defaultColor": "#00ff00", "commands": [ { "name": "Build", "command": "npm run build" }, { "name": "Test", "command": "npm test", "color": "#ff0000" } ] } } ``` -------------------------------- ### Configure Rust Cargo Commands for VSCode Action Buttons Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt This JSON configuration defines action buttons for VSCode to execute common Rust Cargo commands. It includes buttons for running, building, testing, linting with Clippy, and generating documentation. Each button has a name, the corresponding Cargo command, and a display color. ```json { "actionButtons": { "defaultColor": "#dea584", "reloadButton": null, "commands": [ { "name": "$(triangle-right) Run", "command": "cargo run", "color": "#48bb78", "singleInstance": true, "saveAll": true }, { "name": "$(package) Build", "command": "cargo build --release", "color": "#4299e1", "saveAll": true }, { "name": "$(beaker) Test", "command": "cargo test", "color": "#ecc94b", "saveAll": true }, { "name": "$(checklist) Clippy", "command": "cargo clippy -- -D warnings", "color": "#ed8936" }, { "name": "$(book) Docs", "command": "cargo doc --open", "color": "#9f7aea" } ] } } ``` -------------------------------- ### Inherit Global Commands Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Allows workspace-specific settings to inherit commands from global user settings, facilitating shared button configurations across projects. ```json { "actionButtons": { "inheritGlobalCommands": true, "commands": [ { "name": "Project Specific Task", "command": "npm run custom-task" } ] } } ``` -------------------------------- ### Configure Action Buttons in settings.json Source: https://github.com/seunlanlege/vscode-action-buttons/blob/master/README.md Defines the structure for the 'actionButtons' configuration object. It includes global settings like default colors and a list of command objects that specify the execution behavior, icons, and terminal working directories. ```json "actionButtons": { "defaultColor": "#ff0034", "loadNpmCommands": false, "reloadButton": "♻️", "inheritGlobalCommands": false, "commands": [ { "cwd": "/home/custom_folder", "name": "$(triangle-right) Run Cargo", "color": "green", "singleInstance": true, "command": "cargo run ${file}" }, { "name": "$(tools) Build Cargo", "color": "green", "command": "cargo build ${file}" }, { "name": "$(split-horizontal) Split editor", "color": "orange", "useVsCodeApi": true, "command": "workbench.action.splitEditor" } ] } ``` ```json "actionButtons": { "reloadButton": null, "loadNpmCommands": false, "commands": [ { "name": "Run Cargo", "singleInstance": true, "color": "#af565c", "command": "cargo run ${file}" } ] } ``` -------------------------------- ### Control Terminal Instance Behavior Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Configures whether a command reuses an existing terminal or creates a new one. singleInstance: true recreates the terminal, while false clears it. ```json { "actionButtons": { "commands": [ { "name": "Watch Tests", "command": "npm run test:watch", "singleInstance": false, "tooltip": "Reuses terminal, clears before each run" }, { "name": "Fresh Build", "command": "npm run build", "singleInstance": true, "tooltip": "Creates new terminal each time" } ] } } ``` -------------------------------- ### Execute VS Code API Commands Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Triggers internal VS Code commands using the API. Supports passing arguments to commands via the args array. ```json { "actionButtons": { "commands": [ { "name": "$(split-horizontal) Split Editor", "color": "orange", "useVsCodeApi": true, "command": "workbench.action.splitEditor" }, { "name": "$(search) Find in Files", "color": "yellow", "useVsCodeApi": true, "command": "workbench.action.findInFiles", "args": ["searchString"] } ] } } ``` -------------------------------- ### Configure Action Buttons in settings.json Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Defines the global structure for the actionButtons configuration object. This object controls default button colors, npm script loading, and the reload button behavior. ```json { "actionButtons": { "defaultColor": "#ff0034", "loadNpmCommands": false, "reloadButton": "↻", "inheritGlobalCommands": false, "commands": [] } } ``` -------------------------------- ### Execute Terminal Commands with Variables Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Executes shell commands in the integrated terminal with support for variable interpolation like ${file}. Includes options for working directory, focus, and saving files. ```json { "actionButtons": { "commands": [ { "name": "$(triangle-right) Run Cargo", "color": "green", "singleInstance": true, "command": "cargo run ${file}", "cwd": "/home/custom_folder", "focus": true, "saveAll": true, "tooltip": "Run Cargo on current file" } ] } } ``` -------------------------------- ### Enable Automatic NPM Script Detection Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Enables the automatic generation of action buttons based on scripts found in the workspace's package.json file. ```json { "actionButtons": { "loadNpmCommands": true, "defaultColor": "cyan" } } ``` -------------------------------- ### Refreshing Action Buttons Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Defines a keybinding to programmatically refresh all action buttons without requiring a VS Code window reload. This is useful for applying configuration changes dynamically. ```json { "keybindings": [ { "key": "ctrl+shift+r", "command": "extension.refreshButtons" } ] } ``` -------------------------------- ### Adding Icons to Button Names Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Illustrates how to incorporate VS Code's icon syntax `$(icon-name)` within button names to display visual icons alongside text in the status bar. This enhances the user interface of the action buttons. ```json { "actionButtons": { "commands": [ { "name": "$(play) Start", "command": "npm start", "color": "green" }, { "name": "$(bug) Debug", "command": "npm run debug", "color": "red" }, { "name": "$(package) Build", "command": "npm run build", "color": "cyan" }, { "name": "$(beaker) Test", "command": "npm test", "color": "yellow" }, { "name": "$(terminal) Shell", "useVsCodeApi": true, "command": "workbench.action.terminal.new" } ] } } ``` -------------------------------- ### Configure Reload Button Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Sets the text for the reload button or disables it. Setting this to null enables automatic configuration reloading. ```json { "actionButtons": { "reloadButton": "♻️", "commands": [ { "name": "Start Server", "command": "npm start" } ] } } ``` -------------------------------- ### Manage Terminal Focus Source: https://context7.com/seunlanlege/vscode-action-buttons/llms.txt Determines if the terminal gains focus after a command is executed. Setting focus to false keeps the editor active. ```json { "actionButtons": { "commands": [ { "name": "Background Build", "command": "npm run build", "focus": false }, { "name": "Interactive Debug", "command": "npm run debug", "focus": true } ] } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.