Xtext’s Formatter2 by Example

Session details
Session Type: 
Experience level: 

Xtext provides an API to easily implement formatters for your language, which is used both when a user presses CTRL+SHIFT+F in the editor and when Xtext serializes EMF models.

For users, a good formatter is not only a convenience while typing, it also simplifies having a consistent formatting across all files of the project and  avoid whitespace-changes in code reviews.

In this talk I will explain the formatter and its API based on a series of examples. The examples start with the most simple scenarios, continue with the most common scenarios and also include some advanced scenarios such as pattern-based formatting and formatter preferences. Also I will show how to debug formatter implementations, how to make sense from the exceptions you may encounter, and how to test your formatter implementation.

Our Sponsors

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

Elite Dual ECE/OSGi CE



Club ECE Sponsor

IoT Theme Day

Project Quality Day

Smart Home Day


EclipseCon Support Other Events

Our Other Events

Eclipse events are hosted all over the world!

  • EclipseCon Europe 2018