Thursday, May 3, 2012

Subwords completion

Not so long ago I was fairly happy with JDT's content assist, and then I started using Subwords completion from Code Recommenders project and now it is fair to say that I cannot write code without it! :-)

The idea is simple enough - you should not have to type a name from the beginning to find a match in the content assist popup. It really helps when I do not know if I have to 'find' an element or 'get' an element.

The feature is sophisticated enough to understand a rough shorthand e.g. dclr for declaration.

It is also sophisticated enough to understand that a method or type name in Java is composed of several words e.g. 'ty + dclr' finds all 'type' + 'declarations'.

Wednesday, May 2, 2012

JDT 3.8/4.2 M7 - New and Noteworthy

As usual we devoted most of our time in M7 towards polish and performance, nevertheless we managed a few new and noteworthy items.

Firstly a word about bracket matching. So far, a matching bracket was found when the caret was placed immediately 'after' a bracket. This caused confusion because a user can also think in terms of placing the caret 'inside' or 'outside' a bracket pair, see bug 9503. We tweaked this during M6 so that the start bracket was highlighted when the caret is before (not after) the end bracket, i.e. bracket matching now worked when the caret was 'inside' a bracket pair. We realized that this was still not ideal, and also that the old behavior was broken which some of users were already accustomed to.

All this has been improved and now a matching bracket is found both when the caret is placed either immediately before or immediately after a bracket i.e. now bracket matching just works in all cases a user might expect it to work.
You can hover over a closing curly brace and see the source near the matching opening brace in a hover. This is helpful when you want to see the code near the start of a long code block. The hover also tells the number of lines in the code block.

The hover is also useful to temporarily 'highlight' a code block.

In M6 we had tweaked the warning on enum based switch statements, unfortunately the tweaks were not ideal and resulted in a bit of activity on bugzilla. This has been improved and new compiler options have been added to take care of all cases.

Those who are using null annotations will also discover that there are a few new quick fixes to help you a little bit.  One set of quick fixes help to quickly setup a project to use null annotations, i.e. appropriately add the annotations jar to the build path. The second set of quick fixes help you fix problems with respect to incorrect usage of null annotations, missing annotations etc. This second set is not yet perfect, see bug 337977

As always, feedback is greatly appreciated especially in the form of bug reports!

In other news, during this milestone I also earned commit rights on Platform/Text project :-)