Commands:
- Gen: Comment selection - selected fragment (
Ctrl+Alt+//Cmd+Alt+/) - Gen: Comment file - entire open file (context menu)
- Size limit - fragment must not exceed
maxInputCharsfrom settings. - Prompt - system + few-shot for the language family + code; optional extra system prompt from settings.
- LLM - streaming (if the server supports it) with character progress; cancel via Progress notification.
- Extract - code from the response (including the last markdown fenced block).
- Validate - after stripping comments, code must match the original.
- Diff (if preview is on) - virtual docs with language highlighting, modal Apply / Reject.
- Stale edit - before apply, check
document.versionand selection text. - Apply -
WorkspaceEditover the original range.
If the model changed more than comments:
- without preview - only Apply anyway / Cancel;
- with preview - the diff dialog shows Apply anyway instead of regular Apply.
- Virtual documents (
gen-comment:) are not cleared while the diff tab is open. - Language highlighting follows
languageId. - Confirmation is modal.
See Chat Comments in settings.md: style, preview, extra prompt.
Strip/comment syntax - commands.md.