Author Archive

Smart Completion of Java Primitive Method Parameters

Tuesday, March 24th, 2009

Many API include methods like setXxx(int) where int is one of the predefined values, typically declared in the same class. The fact that these are just legacy methods that have been created prior to enums invention, does not stop IntelliJ IDEA from helping you with such parameter values. For example, have a look at JList#getSelectionModel. Just invoke the Smart Completion (Ctrl+Shift+Space) inside the call parentheses:

Smart Completion for Primitives

Repetitive Type Parameters Folding

Monday, March 16th, 2009

Aren’t you tired of verbose constructs like this, are you?

For years IntelliJ IDEA has been saving your time spent on writing code like this (Smart Type Completion after new keyword). Now it does so with your brain cycles while you’re reading it:

This new folding will be available in the first Maia EAP.

Determining Template Data Language by a File Extension

Thursday, March 12th, 2009

When using FreeMarker or Velocity with IntelliJ IDEA, you sometimes need to change the underlying language for a template to enable coding assistance and syntax highlighting.

As with IntelliJ IDEA 8.1, you can open the Settings Dialog and select Template Data Languages to specify what language should be applied to a single template, or an entire folder containing template files. IntelliJ IDEA Velocity integration is also capable of determining the language by a double file extension (e.g. foo.java.vm or bar.css.ft).

In the upcoming EAP for IntelliJ IDEA 8.1.1 you will find another way of mapping files to various template languages: open the Settings dialog, select File Types, and click Add or Edit under Registered Patterns.

Closure folding in IntelliJ IDEA 9 (Maia)

Tuesday, March 10th, 2009

IntelliJ IDEA 9 will bring you a clearer code reading experience with the support of folding for probably the most verbose Java constructions — anonymous classes. In IntelliJ IDEA 9 you will have an option to quickly collapse them to compact, easy to read form and back with a single keystroke.

 

Before:

Ordinary anonymous class syntax display

 

After:

Closures folding enabled

 

EAP users will be, as always, the first to try it out when we release the very first Maia builds, so make sure you’re on the list and watch for the news!