Thursday, April 16, 2009

IntelliJ IDEA: Scope-based highlighting in editor

One of the lesser known features is the ability to highlight certain scopes differently in IDEA's editors.

The feature can be accessed via Settings->IDE Settings->Editor->Colors & Fonts->Scope Based. Below the list of already (pre-)defined scopes, you can easily create new custom scopes via 'Edit Scopes...'-button.

Each scope can be assigned a distinct color/font attribute scheme - just like for different language elements.

I'm using this feature to quickly differentiate between "real" testing code and JUnit-classes (pattern: lib:org.junit..*):

More interesting setups than this (very) simplified example are possible, e.g. adding another scope for EasyMock, Spring's Assert, ..

1 comment:

Mike said...