Applying Quick Fixes

Quick Fixes are suggestions for corrections to badly written code. They are provided by the Semantic Analysis mechanism and can be easily applied for fixing code errors.

 

 

Instructions on how to complete a procedure

To apply a quick fix from the code editor:

  1. Open the file containing the problematic code.
    The line(s) containing code to which a quick fix can be applied will be indicated by a lightbulb icon in the vertical marker bar to the left of the editor window.
    See Real Time Error Detection for more information on how errors are indicated.

  2. Invoke the list with quick fixes by executing one of the below options:

    • Hover the mouse over the problematic code section

    • Place the cursor on the problematic code section and press Ctrl + 1

    • Click the lightbulb icon in the marker bar.

    The Quick Fix list suggests options for fixing the code.

  1. Select the required fix from the list by clicking on it or by using the arrow keys and pressing Enter.

  2. The selected fix is applied and the code is changed accordingly.

 

Instructions on how to complete a procedure

To apply a quick fix from the Problems view:

  1. Open the Problems view.
    The errors and warnings to which a quick fix can be applied will be indicated by a lightbulb icon .
    See Real Time Error Detection for more information on how errors are indicated.

  2. Invoke the list with quick fixes by executing one of the below options:

    • Right-click and select Quick Fix from the context menu.

    • Press Ctrl + 1

    The Quick Fix dialog suggests options for fixing the code.

  1. Select the required fix from the list by clicking on it or by using the arrow keys. Then click the Finish button or press Enter.

  2. The selected fix is applied and the code is changed accordingly.