Institute for
HSR

Groovy Eclipse Plug-in

Overview

Refactoring - changing the codes structure without a ecting its functionality - is a very common task when it comes to modern software-engineering. Refactoring is something that takes place in every kind, stage or type of a software project. Nowadays most Integrated Development Environments (IDEs) support developers with refactoring features.

There are already various plug-ins that extend the functionality of their IDE to support the Groovy programming language. Most of them only provide basic support (like syntax highlighting or outlines) and only one of them, the JetBrains Groovy plug-in for IntelliJ IDEA provides basic refactorings.

In our term project and in this subsequent Bachelor thesis, we introduce refactoring support for Groovy-Eclipse - the Eclipse plug-in for Groovy. The current version of the plug-in does not support any kind of automated refactorings.

To achieve this goal, we had to x various issues in the core of the Groovy language. We did depend on these, since otherwise it would not have been possible to write an AST rewriter that writes code back the way it looked before, nor would it have been possible to correctly replace tokens in the source code.

Another challenge that we faced during both of the projects was, that the continuous integration of the Groovy-Eclipse plugin has been neglected. There was no solution to build, test and deploy the plugin. Thanks to the new committer rights, we were able to introduce a proper solution for these requirements. The build-server used during our projects is now providing a continuous build of Groovy-Eclipse using the sources from the official repository.

Results

After patching these hitches, the AST represented the code the way we expected it, and we were able to introduce the following refactorings as well as a source code formatter:

  • Extract Method
  • Inline Method
  • Rename Class
  • Rename Local
  • Rename Method
  • Rename Field

Since Java and Groovy are that closely related we also analyzed and documented the options to introduce cross-language refactorings between Java and Groovy.

During our Bachelor thesis we obtained committer rights for the Groovy-Eclipse project and had the opportunity to directly commit our code into the official repository. Most of the code that we produced during the term project and the Bachelor thesis is now part of
the official Groovy-Eclipse distribution.

Download

The results of our work is now available in the official Groovy Eclipse plug-in. Groovy Eclipse Plug-in

Our Project website with our documentation is still available. An other team of students is working at the topic of corss-language refactoring at the HSR.

Refactoring Support for the Groovy Eclipse Plug-in (Demo submission for OOPSLA 08)
Cross Language Refactoring for Eclipse Plug-ins (Submission for Refactoring workshop OOPSLA 08)

Team