Smart Actions
AI actions integrated throughout VS Code: commits, tests, docs, fixes, and more
title: "Smart Actions" description: "AI actions integrated throughout VS Code: commits, tests, docs, fixes, and more" section: "Copilot" readTime: "4 min"
Smart Actions
Smart actions provide AI assistance without writing a prompt — they appear contextually where you need them.
Commit Messages & PR Descriptions
In the Source Control view, click the sparkle icon to generate a commit message based on staged changes. The AI considers:
- Which files changed
- Nature of changes (features, fixes, refactoring)
- Scope and impact
The GitHub Pull Requests extension adds PR title and description generation.
Merge Conflict Resolution (Experimental)
Select the Resolve Merge Conflict with AI button in the editor. An agentic flow analyzes both branches and the merge base to suggest a resolution.
TODO Comment Implementation
With the GitHub Pull Requests extension installed:
- Add a
TODOcomment in code - A code action (lightbulb) appears
- Select Delegate to coding agent — the cloud agent works on it in the background and can open a PR
Editor Right-Click Actions
Right-click selected code → Generate Code (or Explain) to access:
| Action | What it does |
|---|---|
| Explain | Explains selected code in Chat view |
| Fix | Suggests a fix for the selected code |
| Generate Docs | Generates documentation comments |
| Generate Tests | Creates tests in an existing or new test file |
| Review | Posts review comments to the Comments panel |
Fix Testing Errors
From Test Explorer: hover a failing test → click the sparkle icon (Fix Test Failure).
When using agents, the agent monitors test output automatically and re-runs tests after fixing.
Fix Terminal Errors
When a command fails, a sparkle in the terminal gutter offers a Quick Fix (Fix with Copilot) for the error.
Rename Symbols
Press F2 on a symbol to rename it. Copilot suggests new names based on context (inline chat provides the suggestions).
Generate Alt Text (Markdown)
In a Markdown file, place cursor on an image → Code Action → Generate alt text (or Refine alt text to improve existing).
Semantic Search (Preview)
The Search view can find results semantically relevant to your query — even without exact text matches. Enable with search.searchView.semanticSearchBehavior.
Also enable AI keyword suggestions for your search terms: search.searchView.keywordSuggestions. Add Search view results to chat with #searchResults.
Code Review in Pull Requests
With the GitHub Pull Requests extension, use the Code Review button in the Files Changed view; comments appear in the Comments panel.
AI Settings Search
Don't know the exact setting name? Search in the Settings editor and toggle Search Settings with AI (workbench.settings.showAISearchToggle).