--- layout: post title: Xtext 2.7.0 Release Notes date: 2014-09-02 09:30:28 categories: releasenotes ---

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.

Debugging

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

Language

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.
@Retention(RUNTIME)
Type inference for parameterized inner classes was improved and supports types like
Option<T>.Some
The validator will now detect use of deprecated API and is much better at finding dead code. Would you have spotted the following?

Library

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

Debugging

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.