The way to develop astyleclipse


By using a real example to describe how to develop a small eclipse plugin in eclipse spirit.


CDT is a eclipse top project for C/C++ development, not like JDT, it doesn't have formatter tool as default, though it has the extension point there. And I am eager to have this "plugin" to beautify my legacy codes.

I had good experience on programming, but just start to use eclipse for development

Step 1, check whether there is existing eclipse plugin

As a spirit of eclipse - "don't reinvent the wheel", always check whether there are plugins exist already, it can also prevent the competition in the end, think about the "subversive vs subclipse"

Google the web, I found there are 2 plugins exist.

Ok, do it following the instruction, both of them need the indent/astyle installed first, which feels not good, and both of them doesn t work under solaris platform. Besides this, one temple file has to be used when invoking external program, it smells bad - need refactoring ;-). Furthermore, the performance is not excellent.

Step 2, Thinking of DIY and preparation.

As a open source fan, I think probably I shall DIY, then check what shall I do before start

Step 3, DIY

Download the CDT's indent plugin, try it and modify to understand how the plugin and extension works, great, I almost have my own plugin.
Take a look at astyle java version, it has main function which includes methods I can use, great, copy it into my plugin folder, and play a little bit, Ahhh, it works.
Then it is time to publish - Deliver early".find a nice name "astyleclipse", which means astyle engine and eclipse plugin. Register it in 0.0.3 version. Without preference page, all the options are hard coded. One webpage is simple created by coping from others, look nice.

Before publish, it is better to make it easy to use, follow the example in eclipse PDE, add a preference page for selection different styles. It looks it is a qualified plugin now for normal user, let me see how is the feedback from community to see which I shall deliver in next release. Actually I already have a roadmap in my mind.

Step 4, Advertising

Where to advertise ?
Surely is the first choice, register a user there and publish, then to see what happens. I didn't publish or advertise in other place even in forum, just want to track how the open source works, it is another way to learn the eclipse ecosystem.

Step 5, Agile way for frequent delivery

Luckly one user response quickly with bug/feature request, discuss with him and provide some features that he wanted.
User's feedback keep me deliver the new version, sometimes just wonder whether I am so frequent.

Step 6, Next step

This is a small plugin, I develop it mostly for fun. Clover could provide free license for opensource project for quality control, so I can try it for free, wonderful. Later I well request for FishEye


Besides the plugin itself, I am also a fan of agile methodology, so it is a chance for me to practise for a tiny project as well to see how the process of eclipse works

Give me comments if you happened to read this page, larry.caiyu(at)


2006-10-13, Draft is written in Esslingen am Neckar, Germany after Eclipse Summit Europe 2006
2006-10-21, published on own web