Xtending our VHDL Xtext formatter with the formatter2 API

Session details
Session Type: 
Experience level: 
Intermediate
Track: 

The formatter is one of the favourite IDE features of many developers. Always having a consistent code style, never having to worry about tabs, spaces, indentation or alignment is a tremendous help. But have you ever wondered how a formatter works?

With release 2.9, Xtext introduced the world to their new formatter2 API. It allows a formatter to access the text and the node model, as well as the AST. This allows the formatter to have a better understanding of the context, which in turn enables complicated conditional and pattern-aware code formatting.

At Sigasi we used the new API to reimplement our existing VHDL formatter, porting over features such as comment aligning and consistent keyword casing. This also means we had to add brand new features that are not readily available in Xtext.

In this talk we will summarize the basics of Xtext’s formatter2 API, demonstrate the implementation of our enhancements and discuss the problems we encountered along the way.

Schedule info
Session Time Slot(s): 
Wednesday, June 21, 2017 - 09:00 to 09:35

Our Sponsors

For information about becoming a sponsor, please visit the EclipseCon France2017 sponsor prospectus page.

Premium

Basic

Media

Regional Supporter

EclipseCon Support Other Events

Our Other Events

Eclipse events are hosted all over the world!

  • Foss4G NA 2018
  • Eclipsecon France 2018