Activating Inline Assist
- Select code (or place cursor for insertion)
- Press
Cmd+Enter(macOS) orCtrl+Enter(Linux/Windows) - Type your natural language prompt
- Press
Enterto generate
Use Cases
Code Generation
Generate new code from scratch:- Place cursor where you want code inserted
Cmd+Enter→ “Create a function that validates email addresses”- Review the generated code
- Accept with
Tabor reject withEsc
Code Transformation
Transform existing code:- Select the code to transform
Cmd+Enter→ “Convert this to async/await”- Review the diff
- Accept or modify
Multi-selection Editing
Apply changes to multiple locations:- Create multiple selections (
Cmd+Dto select next occurrence) Cmd+Enter→ “Add null checks”- AI processes each selection independently
- Review all changes together
Refactoring
Complex code restructuring:Documentation
Generate documentation:Inline Assist UI
Prompt Editor
When you activate inline assist, a prompt editor appears:- Input field - Type your natural language instruction
- Model selector - Choose which AI model to use
- Settings icon - Access inline assistant settings
- Context indicators - Shows what context is being sent
Generation Preview
As code is generated:- Streaming text - See code appear in real-time
- Diff highlighting -
- Green: Added lines
- Red: Removed lines
- Modified lines show both colors
- Thinking indicator - Shows when model is reasoning (for thinking-enabled models)
Action Buttons
During generation:- Stop (
Esc) - Cancel generation
- Accept (
Tab) - Apply changes - Reject (
Esc) - Discard changes - Retry (
Cmd+R) - Generate a new alternative - Edit prompt (
Cmd+E) - Modify your instruction
Alternative Suggestions
Generate multiple variations:Configure Alternative Models
Cycling Alternatives
- Press
Cmd+R(macOS) orCtrl+R(Linux/Windows) to generate a new alternative - Use arrow buttons to cycle through generated alternatives
- Each alternative is generated by a different model or with different parameters
Advanced Features
Context Integration
The Inline Assistant automatically includes:- Selected code and surrounding context
- File type and language information
- Imports and dependencies at the top of the file
- LSP information (type definitions, symbol information)
- Diagnostic errors in the selected region
Custom Instructions
Add context to your prompt:Code Actions Integration
Inline Assistant integrates with language server code actions:- Place cursor on a diagnostic (error/warning)
Cmd+.(macOS) orCtrl+.(Linux/Windows)- Select “Ask AI to fix this”
Configuration
Model Selection
Choose a specific model for inline assist:default_model.
Streaming Tools
Enable streaming tool execution for iterative improvements:- The AI can make multiple edits in one generation
- Faster iteration on complex transformations
- Better handling of multi-file changes
Temperature Override
Control creativity for specific models:Keyboard Shortcuts
| Action | macOS | Linux/Windows |
|---|---|---|
| Start inline assist | Cmd+Enter | Ctrl+Enter |
| Accept changes | Tab | Tab |
| Reject changes | Esc | Esc |
| Retry/Next alternative | Cmd+R | Ctrl+R |
| Previous alternative | Cmd+Shift+R | Ctrl+Shift+R |
| Edit prompt | Cmd+E | Ctrl+E |
| Stop generation | Esc | Esc |
| Open settings | Cmd+, | Ctrl+, |
Best Practices
Be Specific
❌ Bad: “Fix this” ✅ Good: “Add null checks and handle the case where user.email is undefined”Provide Context
❌ Bad: “Add validation” ✅ Good: “Add validation using the Joi library like we use in other API routes”Use Natural Language
You don’t need to be overly technical:- “Make this code safer” ✓
- “Add error handling for network failures” ✓
- “Use the same pattern as the login function” ✓
Iterate
Don’t expect perfection on first try:- Generate initial code
- Accept it
- Select what needs improvement
Cmd+Enter→ “Now add logging”
Review Before Accepting
Always review generated code:- Check for logic errors
- Verify it matches your coding style
- Ensure dependencies exist
- Test the changes
Combine with Editor Features
- Use multi-cursor for repeated patterns
- Select code blocks (functions, classes) for targeted changes
- Leverage language server errors to guide fixes
Examples
Example 1: Add Error Handling
Before:Example 2: Convert to TypeScript
Before:Example 3: Generate Tests
Before:Troubleshooting
Generation is slow
- Try a faster model (e.g., GPT-4o-mini instead of GPT-4o)
- Reduce the selected context size
- Check your internet connection
- Consider using a local model via Ollama
Results are not relevant
- Be more specific in your prompt
- Include more surrounding code in your selection
- Mention specific libraries or patterns to use
- Try a different model
Changes are not being applied
- Make sure you press
Tabto accept - Check that the file is not read-only
- Verify the file hasn’t been modified externally
Context is wrong
- The assistant uses the code around your selection
- Expand your selection to include more context
- Mention specific files or symbols in your prompt
