Character pairs

Finally! My mac is back. I haven’t made much progress with saturn since my last post but in the meantime I’ve been working on something else: a contribution to eclipse.

When you create a text editor in eclipse, you can specify a character pair matcher that is typically used for highlighting matching parentheses and brackets.

In many cases when eclipse defines an interface, it also provides a default implementation that you can customize and use in your own plugin without having to deal with the full complexity of implementing the interface from scratch. In the case of ICharacterPairMatcher, however, there is no such default implementation. A few months ago I filed a feature request in the eclipse bug system for such a default implementation that you could give a set of which charaters to match, for instance "()", "[]" and "{}" and then this implementation would do all the work.

…yada yada yada, my implementation of such a character pair matcher, DefaultCharacterPairMatcher, is now a part of eclipse, as well as a new implementation of the matcher used in the Java editor. So, barring some unforeseen incident, from the next release of eclipse, my code will spring into action whenever you type a parenthesis, brace or bracket in the Java editor or any other editors that use the default character pair matcher. I think that’s pretty cool.

Leave a Reply

Your email address will not be published.


*