VS Code Extension
The extension shows policy violations inline as you code — same visual style as TypeScript errors and ESLint.Requirements
VS Code 1.85 or later.Install
- Open VS Code
- Extensions sidebar (
Cmd+Shift+X/Ctrl+Shift+X) - Search for “MergeGuide”
- Click Install
Real-time Diagnostics
Policy violations appear inline as you type:- Red squiggles = error-severity (blocks commit)
- Yellow squiggles = warnings
- Blue squiggles = info
Problems Panel
All violations in your workspace appear in the Problems panel (Cmd+Shift+M), grouped by severity and file.
Quick Fixes
Many violations offer automatic fixes:- Click the lightbulb icon or press
Cmd+. - Select from available options:
- Fix this violation — Apply suggested fix
- Ignore this line — Add inline ignore comment
- Ignore this file — Add to
.mergeguide.yamlignore patterns
Sidebar Views
The MergeGuide sidebar (activity bar) includes three panels:- Policy Violations — All current violations in the workspace
- Policies — Available policies and their enabled state
- Evaluations — History of evaluation runs
Status Bar
Shows current check status and violation count for the active file. Click to view details.Pre-commit Integration
The extension installs a shell-based git pre-commit hook. When enabled, policy checks run before every commit — the same checks that run in CI, at the point where fixes are cheapest.Commands
Access via Command Palette (Cmd+Shift+P):
| Command | Description |
|---|---|
MergeGuide: Check Current File | Run check on active file |
MergeGuide: Check All Files in Workspace | Check entire workspace |
MergeGuide: Reload Policies | Refresh policy cache from API |
MergeGuide: Set API Key | Securely store API key in VS Code SecretStorage |
MergeGuide: Clear API Key | Remove stored API key |
MergeGuide: Check Authentication Status | Verify API key and connection |
MergeGuide: Pre-Commit Policy Check | Run check manually as pre-commit step |
MergeGuide: Install Pre-commit Hook | Install shell-based git hook |
MergeGuide: Uninstall Pre-commit Hook | Remove git hook |
MergeGuide: Navigate to Violation | Jump to violation location in code |
MergeGuide: Refresh Violations | Reload violations panel |
MergeGuide: Refresh Evaluations | Reload evaluations panel |
Configuration
Open Settings (Cmd+,) and search for “MergeGuide”:
| Setting | Description | Default |
|---|---|---|
mergeguide.enable | Enable/disable policy checking | true |
mergeguide.debounceMs | Delay before checking (ms) | 300 |
mergeguide.maxFileSizeKb | Skip files larger than this (KB) | 1024 |
mergeguide.preCommitHook | Hook behavior: prompt, always, never | prompt |
mergeguide.preCommitCheck | Enable pre-commit policy check | true |
mergeguide.preCommitBlockOnErrors | Block commit on error-severity violations | true |
mergeguide.apiUrl | MergeGuide API base URL | https://portal.mergeguide.ai |
mergeguide.policyCacheTtlMs | Policy cache TTL (ms) | 300000 (5 min) |
mergeguide.trace.server | Language server trace: off, messages, verbose | off |
Workspace Settings
Create.vscode/settings.json:
Authentication
Set your API key via the Command Palette:Cmd+Shift+P→MergeGuide: Set API Key- Paste your API key
- Key is stored in VS Code SecretStorage (not plain text settings)
Supported Languages
The extension activates for files in these languages: Python, JavaScript, TypeScript (including JSX/TSX), Java, Go, PHP, Ruby, C#, Kotlin, Swift, Rust, C, C++, Terraform, Dockerfile All 15 languages are supported. Detection coverage follows your organization’s active policies.Troubleshooting
Extension Not Working
- Check Output panel (
View > Output > MergeGuide) - Verify authentication:
MergeGuide: Check Authentication Status - Confirm extension is enabled for the workspace
Diagnostics Not Appearing
- Open a file in a supported language
- Check that
mergeguide.enableistrue - Run
MergeGuide: Reload Policiesto refresh from API
Performance
If the extension is slow on large files:Reset Extension
- Run
MergeGuide: Clear API Key - Disable and re-enable the extension
- Restart VS Code