Thursday, June 25, 2009

AJDT 2.0.0 is released!

We have just released AJDT 2.0.0 for Eclipse 3.5 and 3.4.

Get it now from the update sites:
For Eclipse 3.5: http://download.eclipse.org/tools/ajdt/35/update
For Eclipse 3.4: http://download.eclipse.org/tools/ajdt/34/update

In addition to a new Push In refactoring and ITD-aware navigation and Javadocs, you can find out about what's included in this release at our New & Noteworthy page.

AJDT 2.0.0 will also be available in the upcoming SpringSource Tool Suite 2.1.0.

This release would not have been possible with out help from the AspectJ and AJDT community. So, thank you for your bug reports, patches, discussions and being warm and welcoming to newcomers.

Wednesday, June 3, 2009

Update on Greclipse 2.0 (Groovy support in Eclipse)

Today, I decided to run EclEmma on the Groovy-Eclipse plugin test suite. Shockingly, I found that JUnit support, content assist, and code navigation are completely test-fress. So, I took a stab at creating a solid and flexible test infrastructure that makes it easy to write plugin tests, especially ones that exercise the Java model.

How did I do this? I did it by hooking into existing JDT functionality, just like I have been doing for the rest of my work on Greclipse. I downloaded the JDT core tests from CVS and used what I needed. Now, I can write extremely concise tests that exercise the code I want it to. For example, I wrote the following test case that tests code selection on a closure in a groovy script (i.e., this is the code that is executed when you perform Open Declaration in an editor):


public void testCodeSelectClosure() throws Exception {
IPath projectPath = createGenericProject();
IPath root = projectPath.append("src");
String contents =
"def x = {\n"+
"t -> print t\n"+
"}\n"+
"x('hello')\n";
env.addGroovyClass(root, "Script", contents);
GroovyCompilationUnit unit = getGroovyCompilationUnit(root, "Script.groovy");
IJavaElement[] elts = unit.codeSelect(contents.lastIndexOf('x'), 1);
assertEquals("Should have found a selection", 1, elts.length);
assertEquals("Should have found local variable 'x'", "x", elts[0].getElementName());
}


I have written many tests for JUnit support (or is that GUnit?), and some for code selection. I still need to work on content assist. So, I can now be confident that as we make changes towards the 2.0 release, we are not sliding back in functionality. There is a lot of good work that has already been put into the plugin (including groovy-aware type inference for content assist) and we need to make sure that this does not regress as we go forward.