|Example of the suggestion window (click for full picture)
This was a group project I worked on in a team of two throughout my final year for Genesys solutions. Genesys solutions is an independent company that is run completely by Sheffield university fourth year students, and receives some funding from IBM each year. In return several plugins must be proposed and developed by Genesys for IBM’s Eclipse development platform, the plugin I worked on was part of this proposal and can be found here.
The project involved creating a plugin for the Eclipse development environment that could be used to check that code was formatted to a set of standards that were defined in an XML file. The plugin would also suggest corrections for any piece of code that wasn’t formatted correctly, and was designed to be as general and expandable as possible.
The plugin used the idea of templates to find instances of important “blocks” of code. We created several template types that could be used to find anything from single line variable declarations, to multiple line method statements. These templates were then used in the XML standards file to describe how to find and properly format instances of these templates. Along with these definitions other information was stored, such as how to indent child blocks (blocks nested inside another block, such as an if block inside a method declaration), and how to format neighboring blocks (such as whether an else block starts directly after an if block, or on a new line).