Quick-fixes for code issues
JetBrains Rider helps you instantly repair most code issues that it detects in design time. It is as simple as pressing Alt+Enter at a highlighted code issue and choosing the appropriate way to fix the problem or improve the suboptimal code.
Quick-fixes are visually displayed as action indicators to the left of a highlighted code issue. These indicators appear when you place the caret at the code issue. The following indicators imply quick-fixes:
Suggests an inplace refactoring or a refactoring that can fix the detected code issue.
View and apply quick-fixes
Place the caret at the highlighted issue.
Click the desired quick-fix or select it using arrow keys and then press Enter.
In most cases, a quick-fix is applied immediately. However, some quick-fixes (for example, Change All) require user interaction to choose how exactly they transform your code. In these cases, a Hot spot session is deployed in the editor, where you can select one of the suggested values or provide your own values in the active input positions:
To complete the hot spot session:
If JetBrains Rider suggests some values for the current parameter, use Up and Down arrow keys to navigate through the list of suggested values, or just type in a desired value.
Press Tab or Enter to accept the value and move to the input position of the next parameter. If this is the last parameter, the hot spot session completes and the caret moves to the end position defined for the session.
Press Shift+Tab to move the input focus to the input position of the previous parameter.
Press Esc to exit the hot spot session. In this case, all session parameters will be initialized with default values.
Some quick fixes can be applied not only in the current caret position, but in a larger scope. For more information, refer to Fix in scope.