blob: 41e1a7709bdf2387cc466af0c9ed5bdbb7687a1e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Xtext - Xtext 2.6.0 Release Notes</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="The website of Eclipse Xtext, an open-source framework for development of programming languages and domain-specific languages">
<meta name="author" content="Sven Efftinge">
<meta name="author" content="Miro Spoenemann">
<!-- styles -->
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="/Xtext/images/favicon.png">
<link href="/Xtext/css/bootstrap.css" rel="stylesheet" type='text/css'>
<link href="/Xtext/css/bootstrap-responsive.css" rel="stylesheet" type='text/css'>
<link href="/Xtext/css/shield-responsive.css" rel="stylesheet" type='text/css'>
<link href='/Xtext/css/fonts.css' rel='stylesheet' type='text/css'>
<link href="/Xtext/css/prettyPhoto.css" rel="stylesheet" media="screen" type='text/css'>
<link href="/Xtext/css/prettify.css" type="text/css" rel="stylesheet"/>
<link href="/Xtext/css/style.css" rel="stylesheet" type='text/css'>
<!-- cover flow -->
<link href="/Xtext/css/coverflow.css" rel="stylesheet" type='text/css'>
<!--[if lt IE 9]>
<link href="/css/iebugs.css" rel="stylesheet" type='text/css'>
<![endif]-->
<!-- BEGIN Cookie Consent
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
},
"theme": "edgeless",
"type": "opt-in",
onInitialise: function (status) {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && didConsent) {
// TODO: enable cookies
}
if (type == 'opt-out' && !didConsent) {
// TODO: disable cookies
}
},
onStatusChange: function(status, chosenBefore) {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && didConsent) {
// TODO: enable cookies
}
if (type == 'opt-out' && !didConsent) {
// TODO: disable cookies
}
},
onRevokeChoice: function() {
var type = this.options.type;
if (type == 'opt-in') {
// TODO: disable cookies
}
if (type == 'opt-out') {
// TODO: enable cookies
}
},
"content": {
"href": "http://www.eclipse.org/legal/privacy.php"
}
})});
</script>
END Cookie Consent -->
</head>
<body>
<header class="site-header">
<!-- Navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse"
data-target=".nav-collapse"> <span class="icon-bar"></span> <span
class="icon-bar"></span> <span class="icon-bar"></span>
</a> <a class="brand" href="/Xtext/index.html"></a>
<div class="nav-collapse collapse" style="height: 0px;">
<ul class="nav">
<!--li ><a href="/Xtext/news.html">News</a></li-->
<li ><a href="/Xtext/download.html">Download</a></li>
<li ><a href="/Xtext/documentation/index.html">Documentation</a></li>
<li ><a href="/Xtext/community.html">Community</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Support &amp; Trainings<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://www.itemis.com/en/xtext/support-and-team/" target="_blank">itemis</a></li>
<li><a href="https://www.typefox.io/language-engineering/" target="_blank">TypeFox</a></li>
</ul>
</li>
<li ><a href="http://xtend-lang.org">Xtend</a></li>
</ul>
<!--div class="nav pull-right">
<li ><a><iframe src="https://ghbtns.com/github-btn.html?user=eclipse&repo=xtext&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe></a></li>
</div-->
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
<!-- Navbar End -->
</header>
<div class="page-content">
<div class="wrapper">
<div id="page">
<div class="inner">
<br/><br/>
<div id="maincontainer" class="container">
<div class="span8 offset1">
<h1>Xtext 2.6.0 Release Notes</h1>
<h4>May 21, 2014</h4>
<br/>
<p>
Version 2.6 got many bug fixes and performance improvements (<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&status_whiteboard=v2.6">full bugzilla list</a>). The new features are:
</p>
<section id="todo_tags" style="padding-top: 68px; margin-top: -68px;">
<h2>Task Tags</h2>
<p>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.</p>
<img class="image_between_p" src="/Xtext/images/releasenotes/2_6_0_task_markers.png"/>
</section>
<section id="gradle_plugin" style="padding-top: 68px; margin-top: -68px;">
<h2>Gradle Plug-in</h2>
<p>A gradle plug-in for easy integration of the Xtext-based languages in any Gradle-based Java projects is now available.<br/>
The gradle plug-in is hosted <a href="https://github.com/oehme/xtext-gradle-plugin">at github</a>. </p>
<p>All ou need to do is to add the plugin to your build classpath:</p>
<pre class="prettyprint lang-xtend linenums">
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.xtext:xtext-gradle-plugin:0.0.2'
}
}
</pre>
<p>Add your languages to the xtextTooling configuration</p>
<pre class="prettyprint lang-xtend linenums">
dependencies {
xtextTooling 'org.example:org.example.hero.core:3.3.3'
xtextTooling 'org.example:org.example.villain.core:6.6.6'
}
</pre>
<p>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.</p>
<pre class="prettyprint lang-xtend linenums">
dependencies {
xtext 'com.google.guava:guava:15.0'
}
</pre>
<p>Configure your languages</p>
<pre class="prettyprint lang-xtend linenums">
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'
}
languages{
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'
}
}
}
</pre>
<section id="first_token_syntactic_predicates" style="padding-top: 68px; margin-top: -68px;">
<h2>First-TokenSet Syntactic Predicates</h2>
<p>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 <code>=&gt;</code> operator, the parser would need to match all of those tokens in order to make te decision. The new operator <code>-&gt;</code>
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.</p>
</section><section id="synchronized_expression" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Synchronized Expression</h2>
<p>
The synchronized expression works basically like Java's synchronized statement.
</p>
<pre class="prettyprint lang-xtend linenums">
synchronized(lock) {
// do stuff
}
</pre>
<p>
But of course it is an expression, as everything in Xtend/Xbase. So you can write the following as well:
</p>
<pre class="prettyprint lang-xtend linenums">
someMethodCall(synchronized(lock) { ... })
</pre>
</section><section id="switch_fall_through" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Switch Fall Through</h2>
<p>The switch expression now supports a kind of fall through. Here's an example</p>
<pre class="prettyprint lang-xtend linenums">
switch myOperator {
case '+',
case '-' : handlePlusMinus()
case '*',
case '/' : handleDivMultiply()
default : throw new IllegalStateException
}
</pre>
</section><section id="compound_assignments" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Compound Assignments</h2>
<p>Xtend now supports compound assignment operators.</p>
<pre class="prettyprint lang-xtend linenums">
var i = 0
i += 42
</pre>
<p>Compound operators work on overloaded operators as well. That is you don't need to declare '+=' if you have '+' defined.
Example:</p>
<pre class="prettyprint lang-xtend linenums">
var distance = 15.km
distance += 5.km
</pre>
</section><section id="postfix_operators" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Postfix Operators</h2>
<p>Postfix operators for incrementing and decrementing numbers have been added.</p>
<pre class="prettyprint lang-xtend linenums">
var i = 0
while (condition()) {
i++
}
</pre>
</section><section id="traditional_for_loop" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Traditional For-Loop</h2>
<p>The traditional for-loop from Java is now available in Xtend, too.</p>
<pre class="prettyprint lang-xtend linenums">
for (var i = 0; i < 99; i++) {
println(''+i+' bottles of beer on the wall.')
}
</pre>
</section><section id="multivalued_annotation_sugar" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Multivalued Annotations Sugar</h2>
<p>Instead of writing </p>
<pre class="prettyprint lang-xtend linenums">
@SurpressWarnings(#["unused", "unchecked"])
</pre>
<p> you can write</p>
<pre class="prettyprint lang-xtend linenums">
@SurpressWarnings("unused", "unchecked")
</pre>
<section id="xbase_open_implementation" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Open Implementation</h2>
<p>In addition to go to declaration, you can now navigate to existing implementations of a method. It works just like in JDT</p>
<img class="image_between_p" src="/Xtext/images/releasenotes/2_6_0_open_implementation.png"/>
</section><section id="xbase_debug_hover" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Debug Hover Shows Inspect Dialog</h2>
<p>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.</p>
<img class="image_between_p" src="/Xtext/images/releasenotes/2_6_0_debug_hover_variable.png"/>
</section><section id="xbase_hover_annotations" style="padding-top: 68px; margin-top: -68px;">
<h2>Xbase - Hover Shows Annotations</h2>
<p>The declaration hover now includes the annotations.</p>
<img class="image_between_p" src="/Xtext/images/releasenotes/2_6_0_annotations_in_hover.png"/>
</section>
</section><section id="xbase_android_lib" style="padding-top: 68px; margin-top: -68px;">
<h2>Treeshaken Xbase Lib for Android</h2>
<p>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.</p>
<p>The library can be <a href="http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.xtext.xbase.lib.slim">downloaded from maven central</a>.</p>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div id="extra">
<div class="inner">
<div class="container">
<div class="row">
<div class="span6">
<h3 class="footer-links-header">Quick Links</h3>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/legal/">Legal</a></li>
</ul>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org">Eclipse Home</a></li>
<li><a href="http://marketplace.eclipse.org/">Market Place</a></li>
<li><a href="http://www.planeteclipse.org/">Eclipse Planet</a></li>
<li><a href="https://www.eclipse.org/forums/index.php/f/27/">Xtext Forum</a></li>
</ul>
</div>
<div class="span6">
<!-- Social Media Links -->
<h3 class="footer-links-header"">Social Media</h3>
<ul class="footer-links clearfix">
<li>
<a href="https://twitter.com/xtext"><img src="/Xtext/images/Twitter-bird-darkgray.png" class="img-responsive" style="margin-right: 5px;height: 1em;" alt="Twitter icon">@xtext on Twitter</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<a href="#" class="scrollup fadeOutRight animated" style="display: none;">ScrollUp</a>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/Xtext/js/jquery-1.11.3.min.js"></script>
<script src="/Xtext/js/bootstrap.min.js"></script>
<script src="/Xtext/js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="/Xtext/js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script src="/Xtext/js/prettify.js" type="text/javascript"></script>
<script src="/Xtext/js/lang-xtend.js" type="text/javascript"></script>
<script src="/Xtext/js/lang-common.js" type="text/javascript"></script>
<script src="/Xtext/js/custom.js" type="text/javascript"></script>
<!--script src="https://apis.google.com/js/platform.js" async defer></script-->
<!--script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push([ '_setAccount', 'UA-2429174-3' ]);
_gaq.push([ '_trackPageview' ]);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl'
: 'http://www')
+ '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script-->
<script src="/Xtext/js/coverflow.min.js" type="text/javascript"></script>
<script>
$(function() {
$('#coverflow').coverflow({
active : 1,
visibleAside: 2,
overlap : 0.5,
scale : 0.9,
angle : 20,
trigger : {
"itemfocus" : true,
"swipe" : true,
"mousewheel" : false
}
});
$('#coverflow :hidden').toggle();
$(window).resize(function() {
$('#coverflow').coverflow();
});
});
</script>
</footer>
</body>
</html>