Table of Contents


Xtext 2.18.0 Release Notes  Jun 4, 2019


Xtext 2.18.0 is mainly a maintenance release.

Eclipse Integration

Search References Result Page: New Context Actions

The results of the Search References action can now be copied to the clipboard. Further an action has been added to remove search results from the view. Both actions are available from the context menu and by common keyboard shortcuts.

Search References Result Page: New Context Actions

New Quickfix on Empty Keywords

Grammar rules with empty keyword statements ('') are raising errors already. Two new quickfixes have been added that can be used to resolve these errors:

  • Remove the empty keyword
  • Set the keyword value from the declaring rule name

(xtext-eclipse#994)

Fixed Potential Deadlock on Startup

A deadlock may occur on startup of Eclipse. The builder infrastructure has been improved to avoid locking on loading its stored state. (#1460)

Fixed: Exceptions for Closed Projects

When projects are removed from the workspace the ProjectOpenedOrClosedListener may caused exceptions that were logged to the error log. This situation has been fixed with xtext-eclipse#1066.

Refactoring Support: Improved Progress Reporting

The ResourceRelocationProcessor did not forward the progress monitor to the change serializer, which prevented proper feedback and cancellation support during the application of a rename refactoring. The progress monitor is now forwarded. (xtext-eclipse#1053)

Refactoring Support: Improved Memory Utilization

During rename or move refactorings a temporary resource set is created and populated. This resource set was kept in memory, leading to unnecessary memory consumption. Now the memory held by this temporary resource set is released properly. (xtext-eclipse#1048)

LSP Integration

ILanguageServerAccess: Provide Access to Xtext Index

A new method doReadIndex has been added to ILanguageServerAccess to allow access to the IResourceDescritions instance (a.k.a. the Xtext Index). This is useful for certain use cases for LS extension developers. (xtext#1067)

Report Partial Results of Cancelled Multi-Project Builds

When a multi-project build is canceled (another runWrite coming in from the RequestManager), it could be that some projects have already been built. Even though their ProjectManagers have been updated (e.g. their index state), their deltas were never returned, because the BuildManager aggregated all results in a local variable. Build listeners were never be informed about these changes.

The BuildManager has been improved to report also partial results to listeners. (xtext-core#1124)

Improved Handling of Builds Cancellations by didChangeWatchedFiles Notifications

When editing files in an auto-saving editor, didChange notifications are usually followed by didChangeWatchedFiles notifications. The latter cancel the build, but only look at their own changes to decide whether a new build should be issued. The changes from the prior didChange queued on the BuildManager were ignored.

This issue has been improved by reprocessing URIs from cancelled builds in. (xtext-core#1121)

Fixed Unexpected Occurrance Highlighting

In certain situations occurrances were not highlighted properly. The highlighting service has been improved for that. See xtext-core#1090 for details.

Xtext Grammar & Code Generator

Fixed: Illegal Whitespace Removal in Merged Manifests

When re-generating language implementations whitespace was illegally removed for required bundles with changed versions. (xtext-extras#406)

Security

With Bug#544852 a theoretical security issue was reported (CVE-2019-10249). While building Xtext artifacts may be downloaded through HTTP instead of HTTPS. To avoid this, all build related resources have been revised and assured that all artifacts participating in the software build are only downloaded with HTTPS.

  • p2 mirrors are disabled for builds using Eclipse Tycho. (#1427)
  • p2 repository URLs changed from HTTP to HTTPS. (xtext-xtend#759)
  • Maven repository URLs changed from HTTP to HTTPS. (xtext-maven)

Upgrades

  • LSP4J has been upgraded to its latest release 0.7.2.
  • The Java Bytecode Manipultation library ASM has been upgraded to version 7.1.0. (#1440)
  • Gradle based projects have been upgraded to use the Gradle Wrapper version 5.4.1.
  • Eclipse Tycho has been upgraded to release 1.4.0. (#1422)
  • In Gradle builds usages of Spring’s dependency-management-plugin have been upgraded to version 1.0.7.RELEASE. (#1420)

New Features in Xtend

Xtend has learned try-with-resources and the ternary operator. See the Xtend Releasenotes for details.

Credits

The Xtext project is thankful for the dedication of each committer and contributor. This release has been made possible by the following persons (in order of the number of contributed commits to this release to all repositories except xtext-xtend):

  • Christian Dietrich (itemis)
  • Karsten Thoms (itemis)
  • Sebastian Zarnekow (itemis)
  • Jan Koehnlein (TypeFox)
  • Holger Schill (itemis)
  • Arne Deutsch (itemis)
  • Christian Schneider (TypeFox)
  • Titouan Vervack (Sigasi)
  • Max Leuthäuser (itemis)
  • Akos Kitta (TypeFox)
  • Lorenzo Addazi
  • Lorenzo Bettini (Università degli Studi di Firenze)
  • Tamas Miklossy (itemis)
  • Dennis Huebner (TypeFox)
  • RhiobeT
  • Sergio Otero Lopez
  • Eva Poell (itemis)
  • Lieven Lemiengre (Sigasi)
  • Mark Christiaens (Sigasi)
  • Michael Budnick (all4net)
  • Stéphane Galland (Université de Technologie de Belfort)

Fixed Issues

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


Xtext 2.17.1 Release Notes  Apr 3, 2019


This is a hotfix release. Here is the list of fixed issues:

  • There was a bug in the Xtext Builder that leads to non Xtext projects being built by Xtext.
  • The LSP4J version in Xtext 2.17.0 did not match the one in Eclipse 2019-03. Upgraded to LSP4J 0.7.0.
  • The Xtend Batch Compiler preferred classes found on the classpath over local classes.

Xtext 2.17.0 Release Notes  Mar 5, 2019


This release focuses on the compatibility with Java 11 & Eclipse 2019-03, stability, performance and technical debt reduction.

BOM

Xtext 2.17 introduces a new artifact, a Maven BOM (bill of materials). Basically it is an artifact with packaging type pom, which defines dependencies by a <dependencyManagement> section. A BOM is consumed by client projects also by <dependencyManagement> and using the BOM artifact with scope import there.

The BOM declares all dependencies that are used by Xtext and has the coordinates

  • groupId : org.eclipse.xtext
  • artifactId : xtext-dev-bom

The xtext-dev-bom is used in Maven configurations as follows:

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>xtext-dev-bom</artifactId>
				<version>${xtext.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

Any artifact declared by the BOM (e.g. Eclipse Core, EMF, MWE, Guava, LSP4J, JDT, ANTLR) can then be used without declaration of a version.

With Gradle 5 support of BOM managed dependency versions was introduced. The Xtext BOM can be consumed by Gradle projects with the platform dependency:

	dependencies {
		compile platform("org.eclipse.xtext:xtext-dev-bom:${xtextVersion}")
	}

Java 11

Xtext and Xtend now fully support Java 11! With Xtext 2.16 it was already possible to run Xtext on a Java 11 VM, but it was not possible to use Java 11 also as the target Java version. Since this required Java 11 enabled versions of Eclipse JDT, Tycho and Gradle and not all were available and especially not tested with Xtext, we had to defer the full support to 2.17.

Now with that latest and greatest versions of JDT, Tycho and Gradle integrated, there are no restrictions to use Java 11 in any of the configurations.

Customizable Exception Handling of Validation Code

By default Xtext swallows NullPointerException occuring during the execution of validators. While this behavior is desirable in most cases and users are not bothered with faulty validation or the likely case of NPEs caused by accessing unresolvable proxies, it may be desirable to report or rethrow these exceptions. To minimize the effort of customizing, the handling of exceptions is delegated to the new API method AbstractDeclarativeValidator#handleExceptionDuringValidation(Throwable). Clients may overroide this method to change the exception handling behavior in their validator classes. (to issue)

Guava 21.0 Version Pinning

Xtext allowed a version range from 14.0 to 21.0 for the Guava library in the past. Effectively this range became invalid since API introduced with Guava 20.0 was used in Xbase. The open version range lead also to other surprises in the past.

With Xtext 2.17 it was decided to pin the required version of the Guava library to 21.0 only. This affects all bundle manifests for plugin builds as well as Gradle & Maven builds through the introduced BOM (see above). Also the New Project Wizard will respect this restriction for newly created projects. (to issue)

Xtext Grammar Language

New Validation: First Rule Must Not Be a Fragment

An Xtext grammar’s first rule must not start with a fragment rule. This is now checked by an additional validation rule. (to issue)

Validation: first rule not a fragment

Testing

Hyperlinking

A new base class AbstractHyperlinkingTest has been added to provide a convenient way to test hyperlinking navigation.

All standard example projects have been updated to provide a test class (<LangugageName>HyperlinkingTest.java) for demonstration. (to issue)

JUnit 5 Support

The package org.eclipse.xtext.testing.extensions introduced with release 2.14 is now public API, thus users of Xtext JUnit 5 support will no longer receive restricted API usage warnings.

The New Project Wizard selects JUnit 5 as default.

JUnit 5 support as default

xtext-maven-plugin

Output Configuration Name

It is now possible to configure set the name attribute for non-default output configurations. (to issue)

Upgrade to Maven 3 API

The xtext-maven-plugin has been refactored to use the latest Maven 3 API. The most significant internal change is that all doclet based configurations have been changed to use Maven 3 annotation API.

xtext-web

The Xtext web support has been updated to the latest versions of the used libraries and editors. Particularly we upgraded to:

  • requirejs 2.3.6
  • jquery 3.3.1-1
  • ace 1.3.3
  • codemirror 5.41.0
  • Orion 17

Upgrades

Xtext builts on top of numerous technologies which frequently provide releases. An important task is therefore to keep up-to-date with the latest from the used technology stack. All upgrades affect Xtext in multiple ways:

  • All internal usages for building Xtext use the upgraded versions
  • The New Project Wizard produces projects that make use of upgrades
  • Our provided Oomph setup has been updated to reflect the latest changes

Eclipse 2019-03

As member of the Eclipse Simultaneous Release Xtext is also built against the latest target platform 2019-03.

Gradle 5.2.1

We upgraded to Gradle 5.2.1. This version is used especially to support the introduced Maven BOM (see above) “natively” in Gradle configurations.

Tycho 1.3.0

Tycho 1.3.0 is required especially for full Java 11 support.

MWE 2.10

Xtext is now the latest release 2.10 of the Modeling Workflow Engine (MWE). The MWE project has been updated to use a recent Xtext version itself and supports now separate source folders for main sources and tests.

Eclipse Orbit

Xtext uses the Orbit repository https://download.eclipse.org/releases/2019-03/ for third party libraries. The location redirects to the latest repository recommended for the simultanous release.

Credits

The Xtext project is thankful for the dedication of each committer and contributor. This release has been made possible by the following persons (in order of the number of contributed commits to this release to all repositories except xtext-xtend):

  • Christian Dietrich (itemis)
  • Karsten Thoms (itemis)
  • Sebastian Zarnekow (itemis)
  • Tamas Miklossy (itemis)
  • Holger Schill (itemis)
  • Arne Deutsch (itemis)
  • Prajwal Gowda (itemis)
  • Anders Dahlberg (Ericsson)
  • Eva Poell (itemis)
  • Lorenzo Addazi
  • Jan Rosczak
  • Jelle Schuhmacher (Altran)
  • Titouan Vervack (Sigasi)
  • Jonathan Menzies
  • Christian Schneider (TypeFox)

Fixed Issues

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


Xtext 2.16.0 Release Notes  Dec 4, 2018


This release focuses on stability, performance and the compatibility with Eclipse 2018-12.

Java 11 preparation

Java 11 has been released in September 2018 and Xtext is in preparation for full support. Xtext relies on plenty of different components, each of which need to work with Java 11. So far, not all of these are available themselves. Other parties have released new versions that could not be integrated yet. As a result we had to reschedule Java 11 support for Xtext 2.17. However, some preparational work has already been included into Xtext 2.16:

  • ASM 7: The ASM bytecode analysis and manipulation framework has been upgraded to the latest version 7.0.
  • Tycho 1.3: Tycho 1.3 is built against latest JDT, which is required to use Java 11. All projects and wizards have been upgraded to Tycho 1.3.
  • Gradle: Xtext 2.16 builds against and uses Gradle 4.10.2 now.

Testing

Quickfix testing API

A new base class AbstractQuickfixTest allows the definition of test cases for quickfixes. Quickfixes can be tested by using the method

public void testQuickfixesOn(CharSequence model, String issueCode, Quickfix... quickfixes)

This method takes the original DSL text as its first argument. The second argument is the issue code of the problem that can be fixed by the quickfixes under test. Finally the third argument is an array of Quickfix testing instances. A testable Quickfix defines a label, a description and the expected resulting DSL text.

	@Data
	protected static class Quickfix {
		String label
		String description
		String result
	}

The Xtext example projects Domainmodel, Statemachine and Home Automation do include exemplary tests to demonstrate its usage. The Domainmodel example’s quickfix test looks like this:

class QuickfixTest extends AbstractQuickfixTest {

	@Before
	def void setup() {
	}

	@Test
	def fix_invalid_entity_name() {
		'''
			entity blog {
			}
		'''.testQuickfixesOn(INVALID_TYPE_NAME, new Quickfix("Capitalize name", "Capitalize name  of 'blog'", '''
				entity Blog {
				}
			''')
		)
	}
	..
}}

New Project Wizard

  • The New Xtext Project wizard selects JUnit 5 as default now.
  • Maven build support: the maven-clean-plugin configuration in the parent pom.xml has been fixed.
  • Gradle build support: Upgrade to Gradle wrapper 4.10.2.

Xbase Library

The Xbase library supports now accessors for two-dimensional arrays.

Parallel Project Build Support

With Eclipse 4.8 (Photon) the Eclipse Platform is supporting parallel build of projects in the workspace. Enabling this feature requires that all configured builders of a project are defining a fine grained scheduling rule. For the XtextBuilder the scheduling rule is configurable by preference now.

The preference is not configurable through preference pages. To enable it, set the org.eclipse.xtext.builder/schedulingrule preference option programmatically or by providing a preference file. The supported values are:

  • WORKSPACE: Workspace root scheduling. This is the default value.
  • ALL_XTEXT_PROJECTS: Lock all projects with Xtext nature configured. Allows projects of other natures to be built in parallel.
  • PROJECT: Locks the currently built project.
  • NULL: No locking

This feature is experimental for now.

Language Server Support

Upgrade to Eclipse LSP4J 0.6.0

Xtext 2.16 integrates Eclipse LSP4J version 0.6.0.

Hierarchical Document Symbols

Xtext now supports the hierarchical document symbols as a response to the textDocument/documentSymbol request (introduced in LSP 3.10.0). For this support a new interface IDocumentSymbolService has been added to the bundle org.eclipse.xtext.ide. By default it binds to a no-op implementation. Hierarchical symbols can be activated by binding the interface to the HierarchicalDocumentSymbolService implementation.

Configurable Server Exit Behavior

The default behavior on receiving the exit command of Xtext language servers was to call System.exit and thus terminate the JVM. While this is desirable when a host process is shut down (like termination of the editing tool), it harms scenarios where the language server and client run on the same JVM.

To support both use cases, the exit command is now delegated to the ILanguageServerShutdownAndExitHandler. Its default implementation ILanguageServerShutdownAndExitHandler.DefaultImpl preserves the existing behavior and invokes System.exit(). For embedded scenarios, the interface can be bound to ILanguageServerShutdownAndExitHandler.NullImpl instead, which ignores the exit request and keeps the JVM alive.

Minimal Target Platform

The Eclipse Platform has changed the release cadence after its Photon release (4.9) to quartely major releases. This increases the speed of changes to the platform that Xtext relies on. Since Xtext integrates deeply with the platform, its becoming harder to to support a wide range of releases. Therefore we decided to cut off the supported Eclipse releases and require at least Eclipse 4.7.3a (Oxygen.3a, latest Oxygen release).

This has now been enforced by constraining the lower bound of all bundles of the Eclipse Platform. As a consequence, Xtext 2.16 can no longer be installed on an older Eclipse release.

Deprecation of GWT

We will no longer maintain the GWT versions of Xbase and Xtend Lib. The corresponding jars will be no longer published with future versions of Xtext (likely from 2.17 on).

Outlook for 2.17

Java 11 Support, a Maven BOM and a new MWE version are planned for 2.17

Fixed Issues

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


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:

-targetDir=./mydsl
-languageName=org.xtext.example.mydsl.MyDsl
-baseName=org.xtext.example.mydsl
-extension=mydsl
-enabledProjects=GenericIDE,RuntimeTest,UIProject,UITest,P2Project
-buildSystem=MAVEN
-sourceLayout=PLAIN
-languageServer=APP
-xtextVersion=2.15.0
-projectLayout=FLAT
-javaVersion=JAVA10

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

org.junit.jupiter:junit-jupiter-api:5.0.0

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:

@Deprecated

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.

@Final

A rule marked with @Final cannot be overridden.

@Exported

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.

Performance

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.

QueuedBuildData

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.

Multi-Quickfixes

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

TBD

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">
	<content-type
		base-type="org.eclipse.core.runtime.text"
		file-extensions="mydsl"
		id="org.eclipse.xtext.mydsl.MyDSL.contenttype"
		name="MyDSL File"
		priority="normal">
	</content-type>
</extension>

New API

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">
   </strategy>
</extension>

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.

@FinalFieldsConstructor
@Accessors
class Planet {
	final String name
	final List<Moon> moons
}

@FinalFieldsConstructor
@Accessors
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 = planets.map[moons].flatten.map[name]
		val moonNames_new = planets.flatMap[moons].map[name]
	}
}

Tracing

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.

Refactoring

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 build.properties) 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 {
	
	@TracedAccessors(MyDslFactory)
	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»
				«generateClass(c)»
			«ENDFOR»
		''')
	}
	
	@Traced def generateClass(ClassDeclaration it) '''
		class «_name» {
			«FOR m : members»
				«generateMember(m)»
			«ENDFOR»
		}
	'''
	
	@Traced def dispatch generateMember(Operation it) '''
		«_name»(«FOR it : parameter»«_name» : «_type[name.name]»«ENDFOR») : «_type[name.name]»
	'''
	
	@Traced def dispatch generateMember(Property it) '''
		«_name» : «_type[name.name]»
	'''
	
}

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

Usability

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.

Performance

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.