Table of Contents

Xtext 2.15.0 Release Notes  Sep 4, 2018

This release focusses on stability, performance and the integration in Eclipse 2018-09.

Minimal Required Target Platform

Xtext and Xtend 2.15 are built and tested against Eclipse Oxygen 3a and newer. Thus we recommend to use at least Eclipse Oxygen 3a or even better Eclipse 2018-09. For older versions of the Eclipse Platform we cannot guarantee backwards compatibility even though we carefully assess any changes that are made.

Support for designated test source folders

Recently Eclipse started to support Java projects with additional source folders that are specifically used for test sources. The project layout thus is more flexible and can be aligned with Maven or Gradle defaults. Test folders are highlighted in the UI and the class path for test sources and non-test sources are separated. This ensures that production code does not reference any test code. The Xtext new project wizard now ensures that new projects mark their source folders appropriately.

Improved Testing Support

The Xtext UI Testing infrastructure provides the org.eclipse.xtext.ui.testing.AbstractHighlightingTest base class for testing the syntactical/semantical highlighting behaviour. The Homeautomation and the State-Machine examples contain corresponding highlighting test cases to demonstrate the usage of the AbstractHighlightingTest class.

Improved Progress Reporting

The progress reporting for the Xtext builder was enhanced and does now provide more detailed information about the current task. Especially for full builds it is not easier to estimate the remaining time.

Task tags and TASK tags

The Xtext API for ToDo task tags now supports case sensitive patterns such that a TASK can be rendered differently than a mere Task.

The editing experience for files that are not contained in a workspace has been improved. Navigation and editing works more reliable now.

Command line interface class for project creation

Xtext projects can be created from a command line by invoking the org.eclipse.xtext.xtext.wizard.cli.CliProjectsCreatorMain main class. This class exposes all options that the New Project Wizard offers as command-line options. Call the class to see all options.

Example arguments for the creation of a typical DSL targetting Eclipse UI and Maven Tycho build on Java 10:


API Improvements

The API when working with the Xtext documents was improved. Convenience methods have been added that are more robust against broken document content when the model is accessed from units of work. If you don’t want to see any null resource or if you want to handle exceptions specifically when accessing the model, you may want to use tryModify or tryReadOnly respectively.

LSP4J 0.5.0

We have updated to LSP4J 0.5.0 which adds support for semantic highlighting.

Although the semantic highlighting Language Server Protocol extension is still in a proposal state, the Xtext-based language server (LS) is one of the early adopters. The semantic highlighting information is calculated on the Xtext language server and pushed to the client as a notification. This notification carries information about the ranges that have to be colored on the client-side. The desired coloring details are given as TextMate scopes for each affected range. Adopters can reuse the entire highlighting logic from the ISemanticHighlightingCalculator implementation as is to enable the LS-based semantic highlighting. The only thing they have to provide is a mapping between the style IDs and the desired TextMate scopes via the recently introduced token mapper. At this state, it is a must to map each style ID to the corresponding scopes manually.

Update Gradle to 4.9

We have upgraded Gradle to 4.9. New projects are built against the this version.

Fixed Issues

As in every release cycle we were eagerly hunting down bugs, and reviewed and integrated plenty of contributions. More than a 100 issues and almost 300 pull requests have made it into this release. For further details please refer to the following lists:

Xtext 2.14.0 Release Notes  May 23, 2018

While the Xtext project has paid more attention on bug fixing for the past release, Xtext 2.14 is bringing a whole bunch of new features. This version is part of the Eclipse Photon (4.8) simultaneous release. An important focus was to keep up with the fast development pace of important technologies that Xtext is building on. Since its past release, Java 9 and 10 came out. Build technologies like Maven Tycho and Gradle were changed to support that, too. The Language Server Protocol is evolving rapidly. JUnit 5 is adopted by IDEs and build systems. And Xtext is now ready for all of them!

Java 9 and 10 Support

Xtext and Xtend 2.14 are able to compile with and against Java 9 & 10. Here are a few notes on the support

  • There is no native support for Java 9/10 module visibilities but we fall back to jdt/javac on that topic.
  • A current Maven version is required (tested with 3.5)
  • When using Gradle, version 4.7 is required at least. The wizard will create projects accordingly.
  • Java 9 requires Tycho 1.1 or newer, Java 10 requires Tycho 1.2
  • Java 9 requires Oxygen.1a at least, Java 10 requires Oxygen.3a. Eclipse Photon works fine for both.
  • Java 10 requires the org.objectweb.asm library in version 6.1.1

For upgrading existing project use the New Project Wizard to create a project with the desired settings and compare build relevant files (MANIFEST.MF, build.gradle, pom.xml, *.target) with the existing projects.

JUnit 5 Support

Xtext now supports the JUnit 5 framework for writing tests. JUnit 5.1 or newer is required.

For new projects the project wizard’s advanced page allows to select the desired JUnit version.

Created test projects directly only depend on the JUnit 5 API artifact


Additional dependencies are configured by the JUnit Library container. This lowers the coupling to concrete JUnit versions and the test engine used. For example, Eclipse Photon is using JUnit 5.1, while Eclipse Oxygen is using JUnit 5.0. Furthermore, the execution of tests in build systems is using the test engines provided by the build system’s test plugins.

New Grammar Annotations

The Xtext Grammar language supports the following additional annotations for parser rules:


This annotation marks a rule to be deprecated. Issue markers with are produced where a deprecated rule is used. By default the severity of issue is Warning. The severity level can be configured in the preferences. This feature will help you to do smooth langauage evolution of the time by informing your users about deprecated parts.


A rule marked with @Final cannot be overridden.


As a default Xtext exports all elements to the index that have a name. For customizing this behaviour you need to create a custom IDefaultResourceDescriptionStrategy manually.
With @Exported it can be customized on grammar level, which element types are exported to the index. The customization takes effect when at least one rule in a grammar is annotated with @Exported. By doing that you can easily manage visibility of elements and safe memory.

Eclipse Integration

Create Action Quickfix

Rules that can be consumed without object instantiation usually require a Create Action. A typical example is when a rule defines an optional assignment. Xtext reports this as a warning in the grammar file.

For problems of this kind a new quickfix has been added that inserts the Create Action at the proper place of the parser rule.

Code Mining Support

Eclipse Photon (4.8) adds a new API called Code Mining. With it text editors can inline additional semantic information into the text, which is not part of the text itself. A useful example to leverage this is to display names of inferred types, parameter names of a called function etc.

Xtext adds a new bundle org.eclipse.xtext.ui.codemining which is offering an API for usage of Code Mining with Xtext. The code generator fragment org.eclipse.xtext.xtext.generator.ui.codemining.CodeMiningFragment can be added to the generator workflow to create a stub implementation and provide all dependencies and bindings for the use of this API.

An example implementation has been added to the Domainmodel Example DSL. To learn more about the usage of this API install the example from the File menu and look up the DomainmodelCodeMiningProvider class.

New Project and File Wizard

With two simple switches you can turn on the generation of a New Project Wizard and a New File Wizard for your language.

These wizards are based on flexible templates to generate one or many projects with any number of files. You can enable the generation from your .mwe2 file with two simple switches:

language = StandardLanguage {
    name = "org.xtext.example.mydsl.MyDsl"
    fileExtensions = "mydsl"
    fileWizard = {
        generate = true
    projectWizard = {
        generate = true

The wizard to create projects allows to select from a number of templates and creates one or, in certain situations helpful, even many projects.

The wizard to create files is more simple in its basic form and skips the template selection if there is only one file template.

In case there are many templates the wizard gets a second page to configure the parameter whereas on the first page a combo box to select the template appears.

The UI for the parameters of the templates as well as the templates them self are defined in code with a concise API. You do not need to fiddle around with SWT widgets and get most UI stuff for free. The templates are generated in the UI project of your language. You can adapt the generated templates, add new ones or contribute new template providers through extension points.

If you generate the wizards for an existing project the plugin.xml is not regenerated to not risk loosing manual changes you might have applied. Instead a plugin.xml_gen is created. You have to merge the generated extensions to your plugin.xml manually.

Console Icon

The Xtext icon has been added for the Xtext console:

Language Server Support

Xtext has been upgraded to LSP4J version 0.4.0. This includes the following features:

  • Implementation of the Language Server Protocol 3.7.0
  • Implementation of the VS Code Debug Protocol 1.25.0
  • Support multiple local and remote services
  • Improved error handling

EMF Support

With EMF 2.14 a new registry EAnnotationValidator.Registry.INSTANCE, which had to be considered in Xtext’s testing support for resetting.

EMF 2.8 introduced the concept ResourceLocator in ResourceSets. Xtext’s specialized implementation XtextResourceSet did not support that so far and has been extended now.

Change Serializer & Rename Refactoring

The past release 2.13 introduced a new API for EMF Model Manipulation and an improved rename refactoring based on the new IChangeSerializer API.

These new features are still incubating. Several issues that were identified by the adoption of the features have been solved.


Output Configurations Cache

A performance bottleneck was discovered in the access to IOutputConfigurations in builder participants. The problem depends on the amount of files produced by code generators.

A cache was introduced in class BuilderParticipant to solve the issue.

Semantic Highlighting

Computation of semantic highlighting was performed twice. This was fixed and should improve editing experience especially for larger files with intensive use of semantic highlighting, for example like the Xtend language.


A bottleneck in class QueuedBuildData has been found that affects the build time for a large number of resources. The build time has been improved for this scenario.

Execution Environment

Xtext 2.14 comes with the following requirements for the execution environment:

  • Java: 1.8, 9 or 10
  • Eclipse Luna (4.4) or newer
  • EMF 2.10 or newer
  • Guice 3.0
  • Tycho 1.1, 1.2 (Java 10 or JUnit 5)
  • JUnit 4.12 or 5.1

Note that bundle org.eclipse.xtext.xbase.lib was compiled with Java 1.8 now, while being compatible to 1.6 in earlier versions.

More detailed information on some topics have been written in blog posts:

Fixed Issues

As in every release we are eagerly hunting down the bugs, review and integrate lots of contributions. 88 issues, 62 Pull Requests and 60 Bugzilla tickets have made it into this release. For further details please refer to the following lists:

Xtext 2.13.0 Release Notes  Oct 20, 2017

Language Server Support

Eclipse New Project Wizard: Language Server Build

The New Project Wizard allows now to build an executable distribution of language server. On the advanced page a new option was added which is enabled when a Build System was selected. The option allows the selection of a distribution type:

  • Regular: A batch script is created that is used to start the server. The DSL jars and all of its runtime dependencies are copied to the output folder.
  • Fat Jar: The language server is packaged in a single executable jar.

Both Gradle and Maven are supported. When activated, the build script of the language’s Generic IDE project is extended and the language server is packaged to the project’s build

Eclipse Integration

Configuration Error Detection

Invalid combinations of bundles are a frequent source of errors. This can be caused by an invalid mixture of Xtext’s UI and runtime plugins, or by DSL plugins developed with a different version of Xtext than used in the environment where it fails.

Although there can’t be done anything to get the plugins working on an invalid environment, the resulting failure messages were not good for the user, leaving an impression of an unstable framework.

When running in an error during the initial creation of Guice injectors in the DSL’s UI or Xtext’s Shared UI bundle, the error is catched and an analysis of the runtime environment is included in the failure message. This allows better analysis of the root cause.


These are quickfixes that allow to be applied to multiple markers at once.


Better Cancellation in Refactorings

You can how hit the cancel dialog in refactorings and it will actually cancel at the next opportunity and not at the end only.

Content Type Descriptor

Xtext UI projects provide a Content Type Descriptor by contributing to the org.eclipse.core.contenttype.contentTypes extension point to the plugin.xml file. This is affecting performance on text searches in Eclipse, since Eclipse can decide that a DSL file has no binary content based on the content type’s base type. (xtext-eclipse/issues/379)

<extension point="org.eclipse.core.contenttype.contentTypes">
		name="MyDSL File"


EMF Model Manipulation API (incubating)

The IChangeSerializer is a new API to listen to changes that are made to the EMF model of an XtextResource and serialize them back to the document’s text. It has a number of benefits to the old XtextDocument.modify() approach:

  • Direct integration with the formatter, such that changes are automatically nicely formatted.
  • Minimum text region changes resulting in less noise.
  • Many points to hook into, e.g. for automatic update of an import section.
  • More ways to optimize for a specific language and to tune performance.
  • Independence from Eclipse-UI concepts like the Document. This makes it reusable in languages server implementations.

You can use the IChangeSerializer for refactorings, semantic quickfixes, code lens etc. It still has a few limitations, e.g. it does not work with derived state models, that’s why we keep it provisional for now.

Nevertheless, we have added the following new features based on it:

Rename Participants for Eclipse File Operations

Some languages tie the model file name to the content, like the package declaration in Java. For such cases you might want to participate in operations on files or directories, like move, rename or paste, to adapt your models automatically. Based on the new IChangeSerializer we have implemented some generic file refactoring participants. You will get notified of such changes to react appropriately by registering your own IResourceRelocationStrategy.

<extension point="org.eclipse.xtext.ui.resourceRelocationStrategy">
   <strategy class="mydsl.MydslExecutableExtensionFactory:mydsl.MydslResourceRelocationStrategy">

Alternative Rename Refactoring for Xtext

By enabling useChangeSerializer flag in the workflow of your language

Workflow {
  component = XtextGenerator {
    language = StandardLanguage {
      renameRefactoring = {
        useChangeSerializer = true

you will use an new, alternative rename refactoring for Eclipse based on the IChangeSerializer. This flag will also generate the binding for the IRenameService and thereby enable rename refactoring on your language server.

Xbase Library (org.eclipse.xtext.xbase.lib)

No-arg overloads to all mutable collection literals

Class CollectionLiterals was extended by no-arg methods for all mutable collection literals:

  • newArrayList()
  • newHashMap()
  • newHashSet()
  • newLinkedHashMap()
  • newLinkedHashSet()
  • newLinkedList()

Xtext’s code base was refactored to use these methods where appropriate. As a consequence Xtext requires at least version 2.13 of org.eclipse.xtext.xbase.lib. Therefore bundle manifests were refactored to constraint the library bundle’s lower version. New projects will automatically add the version constraint to manifests.

flatMap extension method

A new convenience method flatMap has been added to IterableExtensions and IteratorExtensions, which combines map and flatten.

class Planet {
	final String name
	final List<Moon> moons

class Moon {
	final String name

class Planets {
	def static void main (String[] args) {
		val Iterable<Planet> planets = #[
			new Planet("Earth", #[new Moon ("Moon")]),
			new Planet("Mars", #[new Moon ("Phobos"), new Moon("Deimos")])
		val moonNames_old =[moons][name]
		val moonNames_new = planets.flatMap[moons].map[name]


Tracing can now be used for debugging in generated Java code as well. The @Traced annotation now takes optionally a useForDebugging=true. The @TracedAccessors are now adds to the ._<feature>() extension method a ._<feature>(useForDebugging) extension method.


JDT Dependency Reduction

Xtext languages can be deployed in environments without JDT UI. In some use cases it was detected that this can still lead to runtime errors due to (NoClassDefFoundError). Dependencies in the following bundles have been resolved:

We reduced usage of internal API which is subject for removal in JDT. Since older Xtext versions rely on this API, the API is kept by the JDT team for backwards compatibility of Xtext. (bug#525462)

Improved Support for Indentation Based Languages

Token placement for INDENT / DEDENT tokens have been improved. This improves content assist for indentation based languages. (issue#366)

New Generator Infrastructure

Xtext 2.9 introduced a new generator infrastructure. While new projects created with Xtext and the main languages in Xtext already used this generator, there were still some languages, especially test languages, that still used the deprecated old infrastructure. All languages are now migrated to the new generator.

An Eye on Quality

With every release we are working hard on fixing as many bugs as possible. Besides our Bugtrackers Eclipse Bugzilla and GitHub Issues the Automatic Error Reporting System at Eclipse (AERI) is an incredible valuable source of information for us. It uncovers real problems by real users, and has made error reporting to Eclipse a no-brainer.

As Xtext is a complex framework with an incredible flexibility, much can go wrong. Often these errors indicate ways of usage which we could not predict, or they show problems in custom DSLs. Sometimes they uncover also errors in code that we use. We are actively visiting the reports we get into EARI, with a focus on frequently occuring events and new ones.

The Xtext team is proud that this continuous effort finally pays off. For the first time ever, we had several weeks with no new problem report. And fighting against the existing issues no a clear burn-down curve (see the Incidents Timeline). From all problems reported to AERI, we have just ~12% open, and the most frequent and urgent ones are solved.

Improved Developer Contribution Support

Setting up a developer workspace has never been so easy! We have reviewed and updated our Oomph Setup which allows you to create an Eclipse development environment for Xtext with a few clicks. Just get the Eclipse Installer, go to Advanced Mode and select the Xtext subprojects you are working with. Let the Installer do the rest of the work while getting a fresh coffee.

Execution Environment

Minimal requirements are:

  • Java 8
  • Eclipse Luna
  • EMF 2.10
  • Guice 3.0

Xtext has been tested also on Eclipse Oxygen.1a and Eclipse Photon M2.

Some words on Java 9

Java 9 Support in Eclipse Oxygen 1a and Xtext 2.13 is not yet in a perfect state. To be able to run mwe workflows you need either to remove org.objectweb.asm from the mwe classpath (adapting manifest or or install ASM 6.0 from the latest Eclipse Orbit repositories. The Compilation of Xtext projects with Java 9 is terrible slow due to a know bug in JDT. So using Xtext 2.13 and Java 9 in production should be considered thrice and is not recommended. Setting the compiler level to 1.8 mitigates the performance issue slightly.

Fixed Issues

As in every release we are eagerly hunting down the bugs, review and integrate lots of contributions. 88 issues, 62 Pull Requests and 60 Bugzilla tickets have made it into this release. For further details please refer to the following lists:

Xtext 2.12.0 Release Notes  May 25, 2017

Xtext 2.12.0 brings several bug fixes and a new API for tracing generated code.

New Tracing API for Generators

The new API in the org.eclipse.xtext.generator.trace package allows to generate text files along with trace files. These trace files can be used by generic UI such as the “Open Generated File” action as well as domain-specific features such as debugging. It’s very easy to add such tracing information to a code generator, e.g. with Xtend templates:

class MyDslGenerator extends AbstractGenerator {
	static class MyDslTraceExtensions {}
	@Inject extension MyDslTraceExtensions

	override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
		val m = resource.contents.head as Model
		fsa.generateTracedFile("foo/Bar.txt", m, '''
			// generated
			«FOR c : m.types»
	@Traced def generateClass(ClassDeclaration it) '''
		class «_name» {
			«FOR m : members»
	@Traced def dispatch generateMember(Operation it) '''
		«_name»(«FOR it : parameter»«_name» : «_type[]»«ENDFOR») : «_type[]»
	@Traced def dispatch generateMember(Property it) '''
		«_name» : «_type[]»

Here _name and _type are extension methods that are generated for the metamodel of the specific language. They generate text and trace it to the respective part of the DSL source. You can find the full example project on GitHub.

Bug Lists

Xtext 2.11.0 Release Notes  Feb 1, 2017

Version 2.11.0 is the first release of Xtext after its big internal restructuring. The successful core of Xtext is used in many applications and projects around the world, as a result our main focus for 2.11 has been keeping the high quality and stability of the project while setting the course for a more sustainable future.

Restructuring and Build

Xtext and Xtend used to be one big Git repository containing all sources for Eclipse, IDEA, Web integration etc. As of 2.11, we split that into multiple smaller repository, such that you can choose yourself which ones you need. These are

In addition to that, we use Gradle now to build all non-Eclipse artifacts and Maven/Tycho for the Eclipse plug-ins. We have also set up a very sophisticated staged Jenkins build that allows to build from individual branches as well.

Language Server Protocol

With 2.11 the Xtext project supports the language server protocol (LSP), which will allow users to host their languages in many different editors. So far LSP support for VS Code, the Eclipse IDE, Eclipse Che, Eclipse Orion, and Emacs exists. Furthermore Microsoft’s Monaco editor provides support and can be integrated in any JavaScript application.

The LSP support in Xtext v2.11 is marked as provisional to leave open the possibility to further enhance the architecture and API. That said it is known to be used in commercial products already. Also in the long term the LSP support might replace the native web-editor support.

IDEA Support

The IntelliJ IDEA integration of Xtext is currently lacking contributors. Therefore, unfortunately, the IDEA support has not been part of the 2.11 release. Contributions are very welcome!

Important Changes

Execution Environment

All Xtext plug-ins now require JavaSE-1.8 as execution environment. The minimal supported target platform is Eclipse Luna.

Testing Projects

There are new projects org.eclipse.xtext.testing for general testing utility and org.eclipse.xtext.xbase.testing for testing Xbase languages. These projects contain the platform-independent code from org.eclipse.xtext.junit4 and org.eclipse.xtext.xbase.junit, respectively. The classes that have been copied to the new testing projects are now marked as deprecated in the old junit projects, but those can still be used for testing Eclipse UI features.

IDE Guice Module

Xtext uses dependency injection with Guice for language-specific configuration. There are separated hierarchies of Guice modules that aim at different integration platforms: Runtime (core services used by all language integrations), Eclipse, IDEA, and Web. The 2.11 release introduces a new IDE module hierarchy, which is used for generic editor and IDE features. This new module is employed by the web-editor support and the LSP support, but not by the Eclipse and IDEA integrations.

The new IDE module brings reusability of many language-specific services, but the price for this is some API breakage. If you are already using the web-editor support, you’ll need to make a few changes to your language configuration:

  • Remove constructors from <Language Name>WebModule. ExecutorServices are now managed by the ExecutorServiceProvider and disposed by the DisposableRegistry.
  • Move custom bindings for generic IDE services from <Language Name>WebModule to the new <Language Name>IdeModule (e.g. content assist).
  • Fix <Language Name>WebSetup and <Language Name>Servlet; if unsure how to do that, delete them, re-run the language generator workflow, and reapply any customizations you made.

Xbase Features

Improved Xbase Compiler

The Java code produced by the Xbase compiler is now less verbose and more readable. For many situations Xbase does not produce synthetic variables anymore.

For switch statements on Strings an additional null guard is produced. This lead to NPEs when a null argument was passed to the switch statement.

A for-loop over an array resulted in uncompilable Java code. This has been fixed.

Comparison with null

For comparison expressions with null as argument it is more efficient to use the triple (not) equals operator === and !== instead of == and !=. While the “normal” operators will result in a call of Objects.equal, the triple equals operator can perform a direct comparison.

For these situations a warning is produced and a quickfix is offered.

Xtext Project Wizard


We have examined the user experience with the New Xtext Project wizard and improved it with the input we gained from users. It was possible to enter invalid values for project names and file extensions, this is now checked.

An usability test of the advanced configuration page revealed that especially less experienced users could had issues with the dependencies between options. From different proposals it turned out best from the user’s perspective if mandatory options are automatically selected and disable. Further an information message is presented to the user about this action. The ‘Generic IDE Support’ option gets an additional information hover.

The wizard’s text messages have been revised and made consistent.

Line Delimiter

The Xtext project wizard now considers the workspace default line delimiter and configures the generated MWE2 workflow accordingly. As a result the artifacts produced by the Xtext generator will use the same line delimiter explicitly.

Tycho Build Configuration

For projects that are created with Eclipse plug-in and Maven as build system, the generated target definition is upgraded to use the Eclipse Neon repository. Eclipse Tycho is configured with version 0.25.0 now.

Example Projects

The provided example projects have been revised and use the new generator workflow, new project structure and new testing modules.

Deprecated Components

Old Xtext Generator

With Xtext 2.9 a new generator infrastructure was introduced. In favor of this new generator the old generator has been deprecated. Bugfixes will be done primarily for the new generator and most of them will not be backported, thus it is highly recommended to migrate your languages’ .mwe2 workflows to use the new org.eclipse.xtext.xtext.XtextGenerator component.

Running the Language Generator from Maven

The Maven POM module org.eclipse.xtext.xtext, which has been deprecated since 2015, is no longer published. If you use the old generator component, you should replace the org.eclipse.xtext.xtext dependency according to the dependencies of that module. The new generator component requires much fewer dependencies; a suitable configuration for it can be obtained by creating a new Maven project with the Xtext project wizard.

Fixed Bugs

Closed Memory Leaks

The memory leak affected editors and downgraded performance while editing resources for which JVM types are inferred (including Xtend).

A second leak affected the Syntax Graph View and slowed down the IDE.


The Serializer was performing poor for certain grammars. This has been fixed.

Bug Lists

In addition to the restructuring and the LSP support many bugs have been fixed:

Xtext 2.10.0 Release Notes  May 25, 2016

This is a bugfix release. Here is the list of the fixed bugs.

Xtext 2.9.0 Release Notes  Nov 16, 2015

Version 2.9.0 is the first release of Xtext to ship with support for IntelliJ and the Web. Additionally, the “New Project Wizard” does now offer to create Maven or Gradle build support for your new project. Advanced uses may appreciate two new features in the Xtext grammar language.

The release ships with over 240 bugfixes and enhancements. The full bugzilla log can be found here.

The following features have been added in particular.

Develop your Xtext Language in IntelliJ IDEA

Xtext not only lets you develop an IDEA plug-in for your language but you can also do the language development itself entirely within Jetbrains popular IDE.
Check out this tutorial to learn how this works.

Run your Xtext Smart Editor in the Web

With Xtext you can now also have rich text editors for you language in the Web.
With Version 2.9.0 we already support three different javascript editor frameworks. For more details read the corresponding section in the documentation.

New Xtext Project Wizard

A new wizard to produce a readily configured Xtext project has been developed. It is used in both IntelliJ and Eclipse and allows the user to

  • decide which target editors your want (Eclipse, Web, IntelliJ)
  • what build system you prefer (Maven or Gradle)
  • tell the project layout. I.e. whether you want Maven-style src/main/java or the standard src/ folder scheme.
  • and whether you want testing support

New Xtext Code Generator

We have entirely rewritten the code generator that produces the various artifacts from grammars. It is now simpler to configure and at the same time supports the various new options, the new Xtext wizard provides.

Enhanced Gradle and Maven Support

The Maven and Gradle plugins have been overhauled and improved. Additionally we added full support to run, build and test IntelliJ IDEA plugins from Gradle.

Incremental Standalonebuilder

The Eclipse builder always worked incrementally. We have now written one that is Eclipse-independent and is used from within IntelliJ as well as a Gradle Deamon.

Grammar Language Enhancements

New features in the grammar language allow to reduce duplicate grammar information. Fragments are a way to inline similar productions in different rules, while parameters can be used to call turn off parts of a production. More details can be found here.

Xtext 2.8.0 Release Notes  Mar 11, 2015

Version 2.8.0 comes with over 260 bugfixes and enhancements, the runtime performance as well as the tool performance has been improved significantly. The full bugzilla log can be found here.

The following features have been added in particular.

Whitespace-Aware Languages

Xtext 2.8 supports languages in which whitespace is used to specify the structure, e.g. using indentation to delimit code blocks as in Python. This is done through synthetic tokens defined in the grammar:

terminal BEGIN: 'synthetic:BEGIN';
terminal END: 'synthetic:END';

These tokens can be used like other terminals in grammar rules:


The new example language Home Automation available in the Eclipse examples (File → New → Example → Xtext Examples) demonstrates this concept. It allows code like the following:

Rule 'Report error' when Heater.error then
    var String report
        report = HeaterDiagnostic.readError
    while (report == null)

More details are found in the documentation.

Enhancements of the Grammar Editor

Configurable Severities

You can configure the severity (ignore / warning / error) of certain problems that are detected in a grammar file. Open Xtext → Errors/Warnings in the workspace preferences for global settings or in the project properties for project-specific settings.

Improved Content Assist

When you hit Ctrl+Space after the with keyword in a grammar definition, you get a list of available grammars which the currently edited grammar can inherit from.

New Options for Language Code Generation

The Generator component supports two new options.

Class Annotations

You can specify annotations to be added to each generated Java class. With the following workflow configuration, the annotation @Generated is added to each class:

Workflow {
  component = Generator {
      classAnnotation = GeneratedClassAnnotation {}

You can also specify your own class annotations by implementing the interface IClassAnnotation and adding that implementation to the configuration.

File Header

Xtext generates Java files with the following file header comment:

 * generated by Xtext

With Xtext 2.8, this can be configured in the workflow configuration with the fileHeader property of the Generator component.

var myFileHeader = "/*----------------------------
 * My fancy file header
 * (c) \${year} Dr. Evil, inc.

Workflow {
  component = Generator {
      fileHeader = myFileHeader

Target Java Version (Xbase)

The new version of the Xbase compiler allows to configure the Java version of the generated code. The default is to use the same version as set for the source compatibility of the Java compiler (Java → Compiler → Source compatibility), which is in turn usually set to the same version as the compiler compliance level. The Xbase compiler settings can be configured in the Compiler preference page or project properties page of your Xbase language.

By unchecking Use source compatibility level from Java settings, you can choose to generate Java code with a different version than is set for the Java compiler. The actual changes in the generated code are described in the following.

Java 5

Java 5 has been the default version level of the Xbase compiler from the beginning, so the generated code is the same as with earlier Xbase versions if you choose this target version.

Java 6

When the Xbase compiler is set to at least Java 6, it generates an @Override annotation to each method that overrides a method from a superclass or implements an interface method.

Java 7

Xbase expressions like switch (obj) { ... } where obj is of type String are translated to Java switch statements (see Strings in switch Statements).

In Xbase you can write number literals in the form 2_147_483_647 to enhance their readability. This is also supported by Java 7. When the Xbase compiler is set to at least Java 7, underscores in number literals are retained in the generated code.

Java 8

Xbase lambda expressions like [String s | s.toLowerCase] are translated to Java 8 lambda expressions, e.g. (String s) -> return s.toLowerCase();. More details on this translation are discussed in this blog post.

Note that independent of which Java version is chosen for the generated code, Xbase works perfectly with the lambda-optimized Java 8 API because Xbase lambdas are fully compatible with Java 8 lambdas.

More Compiler Options (Xbase)

You can now disable the automatic generation of @SuppressWarnings annotations for generated classes. Furthermore, you can enable the generation of @Generated annotations for all generated types, which can be useful for automatic processing of the source code, e.g. when you want to exclude generated types in code analysis tools. The annotation also allows to attach more information, which can be enabled in the preferences.

Unique Class Name Validation (Xbase)

Unique Java type name checks are now activated for all Xbase languages on a per project level.

Open Generated File (Xbase)

You can open the Java file that was generated from an Xbase DSL instance by right-clicking the DSL editor and selecting Open Generated File.

Interruption of Incremental Build

Instead of blocking the user with a modal dialog, running incremental builds will be now get interrupted when a user saves a file. Less blocking, yay!

New Formatter (Provisional)

Xtext 2.8 comes with a new formatting API in addition to the previous API. The new API allows to implement formatting not only based on the static structure of the grammar but also on the actual model structure. This overcomes many limitations of the previous API, which was present since the first version of Xtext. Things that are now possible include:

  • Add line breaks to long lists of items but keep short lists in one line.
  • Arrange elements in a tabular layout.
  • Apply formatting to values of data type rules or comments.
  • Consider the existing whitespace information and implement an adaptive layout.
  • Provide user configurable preferences for the formatting settings.

More details are found in the documentation.

Storable Resources (Provisional)

Full resolution of Xtext resources can be very expensive. During compilation, complex languages like Xtend go through different phases that involve a lot of computation. With 2.8 we have introduced the possibility to store computed resource state and load it on demand if no changes are expected. We have activated this for Xtend and it reduces the amount of work for incremental changes significantly as dependent resources get loaded from storage much quicker. The API is still provisional for now.

Xtend Features

Convert Java to Xtend

The new version features a Java-to-Xtend converter. Right-click a Java file, package or source folder in the Package Explorer and select Convert to Xtend. You can choose to keep the original Java files (though that will lead to errors due to duplicate types), and you are warned if the Java code contains parts that cannot be translated automatically. These are marked with FIXME comments in the Xtend code. However, the converter is able to convert the majority of Java classes without problems.

More Java 8 Support

The new version of Xtend of course includes all enhancements of Xbase described above, including support for Java 8. In addition, Xtend allows to define non-abstract methods (static or non-static) in interfaces when Java 8 is chosen as target language level. If such a method is non-static, it is translated to a Java 8 default method.

Important Changes

Execution Environment

All Xtext plug-ins now require JavaSE-1.6 as execution environment. Furthermore, the Java code generated by Xtext uses @Override annotations for methods overriding or implementing other declared methods, so the plug-ins into which this code is generated must use at least JavaSE-1.6 as execution environment. If your plug-ins are set to J2SE-1.5 and you run the Xtext 2.8 code generator, you will probably get compiler errors like The method ‘m’ of type ‘T’ must override a superclass method; eliminate them by switching to a higher Java version.

Regenerate Your Xbase Languages

Xbase languages need to be regenerated once in order to work with version 2.8.

Expiring JUnit 3 Support

We are planing to remove support for JUnit version 3. The code form the plug-ins org.eclipse.xtext.junit and org.eclipse.xtext.ui.junit will be removed from our repository in the next version. Please migrate to the respective counterparts in org.eclipse.xtext.junit4.

Xtext 2.7.0 Release Notes  Sep 2, 2014

Version 2.7 got many new features, bug fixes and performance improvements (full bugzilla list). The most noteworthy changes are :

Published Inferrer API of Xbase

The JVM model inferrer API, which is the heart of Xbase, has been finalized and is now public. We took the opportunity to simplify it in some places. Have a look at the updated seven languages example for idiomatic usage of the API.

Performance Improvements

Xtext is now able to cancel many jobs (like refreshing the outline view) when the user starts typing, greatly improving responsiveness. Also, many UI actions can now be cancelled by hitting the "Stop" button. Resource clustering is now supported in the builder participant and standalone builder, reducing the memory footprint for large projects. There is a new parallel builder participant that can be used for even more performance gains.

Better Integration with Xcore

The "New Xtext Project" wizard now supports Xcore models and adding them to an existing mwe2 workflow is as simple as specifying them as a loadedResource. Xcore itself has undergone some serious performance improvements, making it suitable even for large models.


Breakpoints can now be toggled, enabled/disabled and inspected via the ruler context menu. Partial support for conditional breakpoints was added. Content assist in the condition editor will be added in version 2.8.

Find References improved

The find references API is now available in the runtime plugin and has undergone some performance improvements.

Cross Plattform Improvements

All Xtext generator fragments now accept an explicit line delimiter, so heterogeneous teams get the same results when generating the language infrastructure.

Xtend 2.7.0


It is now allowed to leave out parameter declarations for all lambda expressions using a positional syntax.

#[1, 2, 3].reduce[$0 + $1]
Enum constants in annotations can be referenced without their type name.
Type inference for parameterized inner classes was improved and supports types like
The validator will now detect use of deprecated API and is much better at finding dead code. Would you have spotted the following?


The standard library has new extension methods for Iterables, including min/max, groupBy and indexed.

#["Xtend", "Java", "Eclipse"].maxBy[length]

New Active Annotations have been added to free you of some repetitive tasks. The new @Accessors generates getters and setters, with fine grained control and even for all fields of a class if you want. The @Delegate annotation automatically implements the delegation pattern for you, so you only need to concentrate on methods that you actually want to implement differently than just delegating. Here is an example:

interface I {
def void m1()
def void m2()
def void m3()
class A implements I {
override m1() {}
override m2() {}
override m3() {}
class B implements I {
//all methods automatically implemented
@Delegate A delegate = new A

Other additions include @ToString, @EqualsHashCode, @FinalFieldsConstructor and a new @Data (the old one is now deprecated as well as @Property).

The active annotation API integrates even deeper with the IDE. Every generated element can (and should) now declare its source element. This tracing information is used in places like the outline view. A separate validation phase has been added, so the end result after running all transformations can be validated. Also, changes to classes and even arbitrary resources that the annotation processor requested are detected and lead to automatic rebuilds.

IDE Features


Xtend breakpoints can now have conditions. Conditions are written in Java, so you get full access even to synthetic variables inserted by the Xtend compiler. Of course you also get content assist in the condition editor.

Breakpoints can now be toggled, enabled/disabled and inspected via the ruler context menu.

Content Assist

Content Assist has become a lot faster and more accurate at the same time. It will now also retain the "is"-prefix of boolean properties.

Performance Improvements

Performance has reached a new level with big improvements to Content Assist, parallel code generation and lots of fine tuning. Also, Xtend will now cancel jobs (like outline refreshing) when you start typing again, making the editor much more responsive.

Outline with Java-Mode

The outline view now supports two modes: One shows the original Xtend AST, the other one shows the resulting Java AST. This is very useful in the presence of Active Annotations that add a lot of new members to a class.

Organize imports on packages

You can now use "Organize Xtend Imports" on whole packages via the "Source" context menu.

Template proposals support import

A new type of template variable was added. It adds an import to an Xtend file when the template is inserted. This greatly reduces the need for qualified type names in templates.

Open return type

Ever wondered what you can do with the type of a variable or the return type of a method? You can now CTRL-Click on feature calls and open the declaration of the return type of that call.

Show errors from derived Java files

By using black box Java code within active annotations the generated Java source could sometimes have errors while the Xtend code is fine. In those cases, the errors are now shown at the appropriate locations in Xtend as well.

Maven and Java 8

The Xtend Maven plugin is now toolchain-aware. Using this, you can for instance run Maven on Java 8, but compile against a JDK 6.

Xtext 2.6.0 Release Notes  May 21, 2014

Version 2.6 got many bug fixes and performance improvements (full bugzilla list). The new features are:

Task Tags

TODO, FIXME, and XXX markers in comments are now recognized by the IDE as task markers. It will be enabled for all Xtext languages, without any further ado (not even a rebuild is required). To get an corresponding preference page for configuraing the kind of Task markers, a special generator fragment is available.

Gradle Plug-in

A gradle plug-in for easy integration of the Xtext-based languages in any Gradle-based Java projects is now available.
The gradle plug-in is hosted at github.

All ou need to do is to add the plugin to your build classpath:

buildscript {
  repositories {
  dependencies {
    classpath 'org.xtext:xtext-gradle-plugin:0.0.2'

Add your languages to the xtextTooling configuration

dependencies {
  xtextTooling 'org.example:org.example.hero.core:3.3.3'
  xtextTooling 'org.example:org.example.villain.core:6.6.6'

Add code that your models compile against to the xtext configuration. If you use the Java plugin, this configuration will automatically contain everything from compile and testCompile. So in many cases this can be omitted.

dependencies {
  xtext ''

Configure your languages

xtext {
  version = '2.5.3' // the current default, can be omitted
  encoding = 'UTF-8' //the default, can be omitted

  /* Java sourceDirs are added automatically,
   * so you only need this element if you have
   * additional source directories to add
  sources {
    srcDir 'src/main/heroes'
    srcDir 'src/main/villains'

    heroes {
      setup = 'org.example.hero.core.HeroStandaloneSetup'
      consumesJava = true
      outputs {
        DEFAULT_OUTPUT.dir = 'build/heroes'
        SIDEKICKS.dir = 'build/sidekicks'

    villains {
      setup = 'org.example.villain.core.VillainStandaloneSetup'
      //equivalent to DEFAULT_OUTPUT.dir
      output.dir = 'build/villains'

First-TokenSet Syntactic Predicates

Syntactic predicates are used to solve ambiguities in grammars. Sometimes the predicate needs to be set on a more complex rule call, which might involve consuming a great number of tokens. With traditional syntactic predicates using the => operator, the parser would need to match all of those tokens in order to make te decision. The new operator -> tells the parser to only look at the first token and make the decision based on that, which is sufficient in most cases. As a result the parser is faster and does better error recovery.

Xbase - Synchronized Expression

The synchronized expression works basically like Java's synchronized statement.

synchronized(lock) {
    // do stuff

But of course it is an expression, as everything in Xtend/Xbase. So you can write the following as well:

someMethodCall(synchronized(lock) { ... })

Xbase - Switch Fall Through

The switch expression now supports a kind of fall through. Here's an example

switch myOperator {
    case '+',
    case '-' : handlePlusMinus()    
    case '*',
    case '/' : handleDivMultiply()
    default : throw new IllegalStateException

Xbase - Compound Assignments

Xtend now supports compound assignment operators.

var i = 0
i += 42

Compound operators work on overloaded operators as well. That is you don't need to declare '+=' if you have '+' defined. Example:

var distance =
distance +=

Xbase - Postfix Operators

Postfix operators for incrementing and decrementing numbers have been added.

var i = 0
while (condition()) {

Xbase - Traditional For-Loop

The traditional for-loop from Java is now available in Xtend, too.

for (var i = 0; i < 99; i++) {
    println(''+i+' bottles of beer on the wall.')

Xbase - Multivalued Annotations Sugar

Instead of writing

@SurpressWarnings(#["unused", "unchecked"])

you can write

@SurpressWarnings("unused", "unchecked")

Xbase - Open Implementation

In addition to go to declaration, you can now navigate to existing implementations of a method. It works just like in JDT

Xbase - Debug Hover Shows Inspect Dialog

In a debug session, when hovering over a local variable or a visible field, the popo up shows the inspection tree of the hovered value.

Xbase - Hover Shows Annotations

The declaration hover now includes the annotations.

Treeshaken Xbase Lib for Android

For large Android projects there is a need to have as little code packaged as possible. Usually this is achieved by proguarding cour code and the dependencies during the build. For people who find that tedious and want to work with a reduced lib from the get go, we offer a treeshaken version of the library, which is only 300k small.

The library can be downloaded from maven central.