Author Archive

New in 10.5: Create and open tests for Groovy classes faster

Tuesday, April 26th, 2011

We’ve added a couple of new productivity features in IntelliJ IDEA 10.5 to make working with Groovy tests two bits more pleasant:

1. Now you can create tests for Groovy classes the same way you do in Java. You just need to invoke Create Test intention on the header of the class.

2. To navigate to an existing test from a class you can invoke Go to Test action (Ctrl+Shift+T by default).

Make sure to try it in the latest IntelliJ IDEA 10.5 EAP build.

Quick prototyping in Groovy with “Convert Map to Class” intention

Tuesday, April 19th, 2011

Sometimes it is helpful to use a Map for fast prototyping of classes with some properties but without any logic. But in the end it would be nice to have a real class. In IntelliJ IDEA you can get it by invoking “Convert Map to Class” intention on a map.

You only need to type a name and a package for a new class:

And you’ll get something like this…

and a UserInfo class:

Quick and easy, right?

It is not something new, it’s been in IntelliJ IDEA for a while already. We just felt you might not be aware of it.

New in 10.5: Introduce Refactorings for Groovy

Wednesday, April 13th, 2011

In the upcoming IntelliJ IDEA 10.5 some new Groovy refactorings will appear.

The first of them is Introduce Parameter. It allows you to select any expression inside a method and make from it a new method parameter. All the usages of the method in both Groovy and Java will be auto-updated.
Introduce parameter dialog

The second one is Introduce Field which provides you with an ability to quickly create a new field from any expression inside a class.

No doubt these 2 introduce refactorings will be a good addition to the existing Introduce Constant and Introduce Variable. You are using them, right?

Download the latest EAP build of IntelliJ IDEA 10.5 to try these and other new features and to let us know what you think.

New String-related Intentions for Groovy

Wednesday, September 23rd, 2009

With the latest Maia EAP Groovy language support is improved with several new GStrings intention actions.

Now you can convert string concatenations to GStrings…

…and back simply by pressing Alt+Enter, Enter.

Also, IntelliJ IDEA is now aware of that braces can be skipped in some GString injections.