Chat & Inline Editing
Master inline completions, Ctrl+K inline edit, diff overlays, and hunk-level accept/reject.
Inline Completions (Tab Autocomplete)
QCoder provides real-time code completions as you type, similar to GitHub Copilot.
How to enable: Open Settings and toggle Inline Completions to on. You can also enable it per-language.
How it works: - QCoder sends your surrounding code context to the AI model -- 50 lines before and 20 lines after your cursor. - Suggestions appear as ghost text (dimmed text) after a 500ms debounce to avoid excessive API calls. - Press Tab to accept the suggestion. - Press Escape to dismiss it. - Suggestions are cached for 5 seconds so that dismissing and re-triggering the same completion is instant.
Tips: - Write a comment describing what you want, then let the autocomplete fill in the implementation. - Inline completions work best with models that have fast response times (e.g., GPT-4o-mini, Gemini Flash, Groq).
Inline Edit (Ctrl+K)
The inline edit feature lets you select code and give natural-language instructions to transform it, without leaving the editor.
Workflow: 1. Select code in the editor (or place your cursor on a line). 2. Press Ctrl+K to open the inline edit prompt. 3. Type your instruction (e.g., "add error handling", "convert to async/await", "add JSDoc comments"). 4. Press Ctrl+Enter to generate the edit. 5. Review the diff overlay that appears: - Green lines = code being added - Red lines = code being removed 6. Press Tab to accept the changes. 7. Press Escape to reject and revert.
Navigation: - Press Alt+Up and Alt+Down to cycle through your instruction history. - Previous instructions are saved per-session, so you can quickly re-apply similar edits.
Diff Overlay
Whenever QCoder proposes a code change -- whether from chat, inline edit, or agent mode -- it appears as a diff overlay directly in the editor:
- Green lines indicate code that will be added.
- Red lines indicate code that will be removed.
- Changes stream in live as the AI generates its response, so you can see the edit forming in real time.
The diff overlay uses Monaco's native decoration system for crisp rendering that matches your editor theme. Decorations persist until you explicitly accept or reject them.
Hunk-Level Accept and Reject
For edits that span multiple locations in a file, QCoder breaks the diff into individual hunks (contiguous blocks of changes). Each hunk can be accepted or rejected independently.
CodeLens actions appear above each hunk: - Accept -- Apply this specific hunk. - Reject -- Discard this specific hunk and revert the lines.
At the top of the file, you will see global actions: - Accept All -- Apply every hunk in the file at once. - Reject All -- Discard all hunks and revert the entire file.
This granular control lets you cherry-pick the changes you want while discarding the ones you do not need.
The Full Accept/Reject/Apply Cycle
QCoder's edit workflow is fully reversible:
- Apply -- The AI's suggested changes are applied to the file and shown as a diff overlay.
- Accept -- Confirms the changes. The diff decorations are removed and the file is saved.
- Reject -- Undoes the changes by calling
model.undo()and re-shows the diff decorations so you can re-accept if you change your mind.
You can cycle through Accept and Reject as many times as you like. The operation is idempotent -- clicking Accept when there is no pending diff is a no-op, not an error.