You are free to choose whether to apply or not the suggested corrections, but it often worth taking a look at what you can fix or improve in your code.
Action List appears only when Code Analysis is enabled for the current file.
When the Action List is available, an icon appears in the text editor to the left of
the line where the caret is:
Depending on the context, you will see one of the icons described below. When you expand the Action List, you may find more items with different icons there. The meanings of the icons are as follows:
- A quick-fix for a code issue with warning, suggestion or hint severity
- A quick-fix for a code issue with error severity
- A context action
- A refactoring that can fix the code issue
- A code generation action that can fix the code issue
- A surround action and surround templates (appears when you select some code)
- The Inspection options sub-menu with inspection options for the code issue
To view the Action List, click on the icon or press Alt+Enter.
When the Action List expands, you can see all actions available for the current cursor position and selection:
If you find that some action can help you, choose it in the Action List and click on it or press Enter.