Using Hints in Source Code Analysis and Refactoring

See Also

In the Source Editor, a hint is displayed when the IDE performs source code analysis and detects common syntax errors or problems.

An editor hint is available if a lightbulb icon appears in the left margin of the Source Editor while you are developing your code. You can read the hint by clicking the lightbulb icon or by pressing Alt-Enter. You can generate the code suggested by the hint by clicking the hint or by pressing Enter.

You can use hints when running source code inspections on a selected file, package, or project and refactoring your sources.

To initiate the Inspect operation:

  1. Choose Source > Inspect from the main IDE's menu.
  2. In the Scope drop-down list of the Inspect dialog box, select a file, package, or project(s) to be inspected.
  3. Select either of the following to use:
  4. Click Inspect to perform the source code analysis.
    After the Inspect operation is completed, the hints that can be applied to your code are displayed in the Inspector Window below the Source Editor.

To initiate the Inspect and Transform operation:

  1. Choose Refactor > Inspect and Transform from the main IDE's menu.
  2. In the Inspect drop-down list of the Inspect and Transform dialog box, select a file, package, or project(s) to be inspected.
    Alternatively, click the button to the right to open the Custom Scope dialog box and specify the custom code to be inspected.
  3. Select either of the following to use:
  4. Click Refactor to run the source code analysis.
    After the Inspect and Transform operation is completed, the results are displayed in the Inspect and Transform dialog box. Click Preview to display the source code refactorings proposed by the IDE upon conducting the source code analysis with the hints you specified.
See Also
Syntax Rules for Declarative Hints

Legal Notices