Quick Fixes¶
Quick fixes provide one-click solutions for common issues detected by inspections.
Using Quick Fixes¶
Keyboard Shortcut¶
- Place cursor on an error (red or yellow underline)
- Press
Alt+Enter - Select a fix from the popup menu
- Press
Enterto apply
Light Bulb Icon¶
When available, a 💡 light bulb appears: 1. Click the light bulb 2. Select a fix 3. Apply
Context Menu¶
- Right-click on the error
- Select Show Context Actions
- Choose a fix
Available Quick Fixes¶
Create Missing Fragment¶
Applies to: Missing Fragment Reference inspection
What it does: Creates a new .fragment file with the fragment definition.
Example:
include login-steps # Error: Fragment 'login-steps' not found
# Quick fix: Create fragment 'login-steps'
After applying:
Creates login-steps.fragment:
Options¶
When creating a fragment: - File name: Defaults to fragment name - Directory: Choose location for new file - Template: Basic fragment structure
Intention Actions¶
Beyond error fixes, intention actions offer enhancements:
Convert to Fragment¶
Select steps and convert to a reusable fragment.
Before:
scenario: Test 1
given I login
call ^login
extract $.token => token
scenario: Test 2
given I login
call ^login
extract $.token => token
After:
# login-fragment.fragment
fragment: login-steps
given I login
call ^login
extract $.token => token
# test.scenario
scenario: Test 1
given I am logged in
include login-steps
scenario: Test 2
given I am logged in
include login-steps
Inline Fragment¶
Replace include directive with fragment contents.
Before:
scenario: Test
given I am ready
include simple-step
# simple-step.fragment
fragment: simple-step
given I ping the server
call ^ping
After:
Preview Changes¶
For significant changes:
- Press
Alt+Enter - Hold
Altand pressEnteragain - Preview shows before/after
- Confirm or cancel
Batch Apply¶
Apply the same fix to multiple occurrences:
- Select the fix
- Look for Fix all 'X' problems in file
- Apply to all
Custom Quick Fixes¶
The plugin provides quick fixes for BerryCrush-specific issues. For general code issues, use IntelliJ's built-in intentions.
Keyboard Reference¶
| Action | Shortcut |
|---|---|
| Show quick fixes | Alt+Enter |
| Show more actions | Alt+Enter twice |
| Preview change | Hold Alt, press Enter |
Tips¶
Priority Order¶
Quick fixes appear in priority order: 1. Error fixes (most important) 2. Warning fixes 3. Improvement suggestions 4. Other intentions
Undo¶
All quick fixes can be undone:
- Cmd+Z (Mac)
- Ctrl+Z (Windows/Linux)
Learning Shortcuts¶
Press Ctrl+Shift+A (or Cmd+Shift+A) and search for action names to learn their shortcuts.