VS Code Integration Guide
Complete guide to using Radium with VS Code via the radium-vscode extension.
Prerequisitesβ
- VS Code 1.74.0+
- Node.js (for extension development/build)
- Radium CLI installed and in PATH
- Radium workspace initialized (optional, for some features)
Installationβ
Step 1: Install the Extension via Radiumβ
rad extension install radium-vscode
Step 2: Install VS Code Extensionβ
The extension can be installed via:
- Command Palette:
Ctrl+Shift+P(orCmd+Shift+Pon Mac) β "Extensions: Install from VSIX" - Marketplace: Search for "Radium Code Assistant" (when published)
- Manual: Build and install from source (see Development section)
Step 3: Activate Extensionβ
The extension activates automatically when you use Radium commands. No additional setup required.
Commandsβ
All commands are accessible via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Radium: Send Selectionβ
Sends the current selection to Radium for processing.
Usage:
- Select code in the editor
- Open Command Palette (
Ctrl+Shift+P) - Run "Radium: Send Selection"
- Code is sent to Radium with full context:
- File path
- Language identifier
- Selected code
- Workspace information
Output:
- Results appear in a new document in a side-by-side view
- Output is in Markdown format
- Code blocks are highlighted
Radium: Apply Codeβ
Applies the last agent-generated code block to the current file.
Usage:
- After receiving agent output from "Radium: Send Selection"
- Open Command Palette
- Run "Radium: Apply Code"
- Select code block if multiple are available
- Diff preview is shown using VS Code's built-in diff viewer
- Click "Apply" to confirm or "Cancel" to abort
Features:
- Automatic code block detection
- Multiple code block selection
- Side-by-side diff preview
- Inline change application
Radium: Chatβ
Opens an interactive chat session with a Radium agent.
Usage:
- Open Command Palette
- Run "Radium: Chat"
- An integrated terminal opens with
rad chatrunning - Type messages and press Enter
Features:
- Integrated terminal
- Context-aware (includes current file path and language)
- Full chat history preserved
Configurationβ
VS Code Settingsβ
Add to your VS Code settings.json:
{
"radium.defaultAgent": "code-agent"
}
Workspace Settingsβ
Workspace-specific configuration in .vscode/settings.json:
{
"radium.defaultAgent": "workspace-specific-agent"
}
Extension Architectureβ
The VS Code extension consists of:
- TypeScript Extension: Main extension code in
src/ - Radium Extension: Hooks and integration via Radium extension system
- CLI Communication: Uses
rad stepandrad chatcommands
Hook Integrationβ
The extension includes hooks that are automatically registered when the Radium extension is installed:
- BeforeTool Hook: Injects editor context
- AfterTool Hook: Processes agent output for code extraction
These hooks are shared with the Neovim extension.
Workflow Exampleβ
-
Select Code:
- Highlight code in editor
- Use
Shift+Arrowkeys or mouse selection
-
Send to Radium:
Ctrl+Shift+Pβ "Radium: Send Selection"- Wait for agent processing
- Review output in side panel
-
Apply Changes:
Ctrl+Shift+Pβ "Radium: Apply Code"- Select code block if multiple available
- Review diff preview
- Click "Apply" to confirm
Troubleshootingβ
Commands Not Appearingβ
Issue: Radium commands not in Command Palette
Solution:
- Verify extension is installed:
rad extension list - Check extension is activated (should auto-activate)
- Reload VS Code window:
Ctrl+Shift+Pβ "Developer: Reload Window"
CLI Not Foundβ
Issue: Error about rad command not found
Solution:
- Ensure Radium CLI is in PATH
- Test in terminal:
rad --version - Restart VS Code after installing CLI
- Check VS Code's integrated terminal can find
rad
Output Panel Not Showingβ
Issue: Agent output not visible
Solution:
- Check Output panel: View β Output β Select "Radium" channel
- Verify agent executed successfully
- Check for error messages in Output panel
Diff Preview Not Workingβ
Issue: Diff preview doesn't show changes
Solution:
- Ensure you've run "Radium: Send Selection" first
- Verify agent output contains code blocks
- Check VS Code version (1.74.0+ required)
Developmentβ
Building from Sourceβ
cd extensions/radium-vscode
npm install
npm run compile
Installing Development Versionβ
npm install -g vsce
vsce package
code --install-extension radium-vscode-1.0.0.vsix
See Alsoβ
- Extension README (external repository)
- Architecture Documentation
- Troubleshooting Guide