

This allows you to batch-apply quick-fixes to the selected scope without examining each problem individually.ĭuring the cleanup, the IDE applies fixes from the code cleanup inspections in the selected inspection profile. You can streamline the process of fixing problems in your code by running Code Cleanup. Select the problem description, click icon on the toolbar, select the relevant fix, and then select Fix all "" in file from the list. If a problem occurs several times in a file, you can fix all the occurrences at once. You can also press Alt+Enter and select a suitable fix from the popup menu.

To fix a problem, click the icon on the toolbar or in the context menu. Click a problem to display inspection details on the right. All detected problems are listed in the left part of the tool window. If you have invoked inspections manually, you can examine the results in the Problems tool window that opens automatically after the analysis is finished. Select the relevant fix and then select Fix all "" in file from the list. Place the caret at the highlighted piece of code and press Alt+Enter. If a detected problem occurs several times in a file, WebStorm suggests fixing them all at once. Fix all occurrences of a problem in the current file You can hide and show this preview by pressing Control+Q. WebStorm shows an interactive preview next to the quick-fix for some inspections for example, Assignment used as condition, Unreachable 'case' branch of a 'switch' statement, Assignment used as condition, and others. If an inspection has detected a problem in your code, you can quickly apply a fix in the editor.
