# Highlighting

## Syntax highlighting

In order to clearly distinguish different operators and types of keywords in the R language, StatET offers syntactic highlighting.

StatET offers very fine-grained configuration of syntactic highlighting, which is accessible via the StatET preferences in Window > Preferences at: R > Source Editors > R Syntax Coloring (Open)

## Syntax error detection

Syntax errors are detected and by default indicated by squiggly lines on the error location and red rectangles in the right gutter of the editor (the annotations overview). Syntax errors are a type of Eclipse Annotations, so the usual navigation shortcuts for Annotations can be used:

- `Ctrl+.` : navigate to the next annotation
- `Ctrl+,` : navigate to previous annotation

The Syntax error detection feature can be (dis)activated in the StatET preferences at R > Source Editors > R Editing Options by (un)checking the option 'Enable syntax checking as you type'.

## Mark Occurrences

When the pointer is located on a certain variable, the editor will highlight the variable as well as all other occurrences of the variable in the file. The Mark Occurrences feature makes a (very useful) difference between

- occurrences where the value of the variable is changed (write occurrences) and
- plain uses of the variable (read occurrences).

In the following screenshot, both types of occurrences are displayed with their corresponding default colors.

Occurrences are a type of Eclipse Annotations and as such all occurrences of a given variable will also be displayed as small grey rectangles in the right gutter of the editor. By clicking on these small symbols, one can quickly navigate to the desired occurrence.

The Mark occurrences feature can be (dis)activated in the StatET preferences at R > Source Editors > R Editing Options (Open) by (un)checking the option 'Enable mark occurences'. As is indicated in that preferences page, the visual display of the occurrences can be configured at General > Editors > Text Editors > Annotations where 'Occurrences' and 'Occurrences: write' are listed among the Annotation types.