Identifying problems in your code

In this section, you will review the different indicators for identifying problems in your code.

Build problems are displayed in the Problems view and annotated in the vertical ruler of your source code.

  1. Open testlib.oclx in the editor from the Project Explorer view.
  2. Add a syntax error by deleting the last letter at the end of the library name in the code.

    Editor with incorrect library name

  3. The project is rebuilt automatically and the problem is indicated in several ways:

    Problem marker in Package Explorer, editor and Tasks view

  4. You can hover over the problem markers to view a description of the problem.

    Problem marker hover

  5. Click the Close ("X") button on the editor's tab to close the editor.
  6. In the Problems view, select a problem in the list. Open its context menu and select Go To. The file is opened in the editor at the location of the problem.

    Problems view

  7. Correct the problem in the editor by adding the 'b'. The project is rebuilt and the problem indicators disappear. Click the Save button.
  8. You can configure how problems are indicated on the General > Editors > Text Editors > Annotations preference page.

Related concepts

OCL editor

Related reference

OCL Editor Preferences