CLion
 
Get CLion
You are viewing the documentation for an earlier version of CLion.

Get results and fix problems

Last modified: 09 November 2021

By default, CLion analyses the code in all open files and highlights the detected code issues. You can fix most of the issues immediately by applying quick-fixes.

Place the caret at the highlighted piece of code and press Alt+Enter:

Applying a quick-fix in the editor

You can also hover the mouse over the highlighted element and apply a quick-fix from the inspection popup:

Applying a quick-fix in the editor

For some inspections, you can open a preview by pressing Ctrl+Shift+I.

If you perform code analysis or execute a single inspection in a larger scope of source files, CLion displays the detected code issues in the Inspection results tool window. When you select a specific issue in this window, its report is shown in the right part of the window.

If there are available fixes to the issue, CLion notifies it in the following ways:

  • The Apply a Quickfix the Intention action button button becomes available on the toolbar of the Inspection Results tool window.

  • The available fixes are shown in the optional Problem resolution field of the report.

  • The available fixes are shown in the context menu of the issue.

If there are no available fixes, the only option is to fix the issue manually.