MicroPatch (Microfix)
AI‑powered coding assistance for VS Code: fix compiler and linter errors, ask questions about your code, and request edits — from a chat-style sidebar or a full editor-area chat panel.
Features
Chat sidebar (Cline-style UX)
- Conversational chat with the active file, your selection, and diagnostics as context.
- Editor chat panel — run
MicroPatch: Open Chat (or the expand button in the sidebar header) to pop the same chat into a resizable editor tab, side by side with your code. Both surfaces share providers/settings and keep their own conversations.
- Fix errors mode — the AI reviews the active file's errors and proposes edits that you approve/reject before anything touches your code.
- Plan edit mode — ask for a code change and review an inline diff per edit, then apply, reject, or roll back.
- Streamed-style message log with markdown, syntax-highlighted code blocks (copy button), token/cost usage per reply, and persistent conversation across restarts.
Quick fixes
- Inline lightbulb quick fixes, "Fix all errors" (with progress and cancel), diff preview, rollback/redo, per-fix history and file snapshots.
- Fix cache, post-fix verification, terminal-output context, retries.
Providers
- OpenAI, Anthropic, Ollama, OpenRouter, Groq, Google Gemini, LM Studio, Hugging Face, GitHub Models, and any OpenAI-compatible custom endpoint — all 10 configurable from the sidebar.
- Test-connection button per provider, keys stored in VS Code's secure secret storage (never kept in
settings.json).
Privacy & control
- Session token and USD cost budget, secret/API-key redaction, skip rules & file globs, opt-in telemetry, configurable severity filter and context radius.
Setup
- Install the
.vsix (Extensions view → ... → Install from VSIX…).
- Open the sidebar view MicroPatch and click the ⚙ gear → Providers → Add provider.
- Pick a provider, enter your API key (or use Ollama / LM Studio for fully local), hit Test connection, then Save providers.
- Open a file with errors and use the 🛠 Fix errors chip in the chat, or the lightbulb in the editor.
Keyboard shortcuts
| Action |
Shortcut |
| Fix error at cursor |
Ctrl/Cmd + Shift + . |
| Fix all errors in file |
Ctrl/Cmd + Shift + Alt + . |
Commands
MicroPatch: Fix This Error, Fix All Errors, Rollback Last Fix, Open Chat, Show Panel, Show Logs, Configure Providers, Clear History.
Testing
npm test — unit tests: core logic (prompt building, response validation, edit planning) plus headless DOM tests of the sidebar webview UI (test/unit/Webview.test.ts runs webview/sidebar.js in jsdom with a stubbed acquireVsCodeApi).
npm run test:integration — end-to-end suite in a real VS Code extension host (requires a display): verifies activation, all command registrations, the editor chat panel (open/idempotent), a full chat roundtrip against a local mock OpenAI-compatible server (request shape + token tracking), graceful no-provider errors, and applying plan edits to a real file. No API keys needed.
SCREENSHOT_MODE=1 npm run test:integration — opens the sidebar + chat panel, populates a conversation from the mock server, and holds the window open while node scripts/capture-screenshots.mjs captures real window screenshots over the Chrome DevTools Protocol into screenshots/.
Integration tests use an isolated --user-data-dir and never touch your real VS Code settings or stored API keys.
| |