Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>The Groovy-Eclipse team is proud to announce the release of Groovy-Eclipse 2.5.2. There are many new features available with this release, including Eclipse 3.7.1 support, Java 7 support, and Groovy 1.8.2 support</p> <p>You can use the following update site to install this release:</p> <table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Groovy-Eclipse update site for Eclipse 3.7 and 3.6" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9R3Jvb3Z5LUVjbGlwc2UgdXBkYXRlIHNpdGUgZm9yIEVjbGlwc2UgMy43IGFuZCAzLjZ9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>For Eclipse 3.7:<br /> <code><a href="http://dist.springsource.org/release/GRECLIPSE/e3.7/">http://dist.springsource.org/release/GRECLIPSE/e3.7/</a></code></p> <p>For Eclipse 3.6:<br /> <code><a href="http://dist.springsource.org/release/GRECLIPSE/e3.6/">http://dist.springsource.org/release/GRECLIPSE/e3.6/</a></code></p></td></tr></table> <p>If you want the Groovy 1.8 compiler, you must explicitly include it by checking the "Extra compilers" category.</p> <p>And a zipped version of the update site is available at:</p> <table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Zipped Groovy-Eclipse update site for Eclipse 3.7 and 3.6" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9WmlwcGVkIEdyb292eS1FY2xpcHNlIHVwZGF0ZSBzaXRlIGZvciBFY2xpcHNlIDMuNyBhbmQgMy42fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>For Eclipse 3.7:<br /> <code><a href="http://dist.springsource.org/release/GRECLIPSE/e3.7/archive-2.5.2.xx-20110929-1800-e37.zip">http://dist.springsource.org/release/GRECLIPSE/e3.7/archive-2.5.2.xx-20110929-1800-e37.zip</a></code></p> <p>For Eclipse 3.6:<br /> <code><a href="http://dist.springsource.org/release/GRECLIPSE/e3.6/archive-2.5.2.xx-20110929-1700-e36.zip">http://dist.springsource.org/release/GRECLIPSE/e3.6/archive-2.5.2.xx-20110929-1700-e36.zip</a></code></p> <p>You can install from the zip by pointing your Eclipse update manager to the downloaded zip file and following the installation instructions.</p></td></tr></table> <h3>Outline</h3> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvYzptYXhMZXZlbD00fGluZGVudD0yMHB4fHN0eWxlPWRpc2N8ZXhjbHVkZT1PdXRsaW5lfQ&locale=en_GB&version=2" data-macro-name="toc" data-macro-parameters="exclude=Outline|indent=20px|maxLevel=4|style=disc"> <h3>Groovy 1.8.2</h3> <p>Groovy 1.8.2 is now available as an optional install from the update sites.</p> <h3>Java 7 and Eclipse 3.7.1</h3> <p>Groovy-Eclipse now ships with Java 7 compatibility and can install on Eclipse 3.7.1.</p> <h3>Compiler switching through command line argument</h3> <p>It is now possible to use command line arguments to specify a compiler level for Groovy-Eclipse. You can add the <code>-groovy.compiler.level</code> argument to the launch command to control which compiler level is started.</p> <table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>Use <code>-groovy.compiler.level 18</code> to specify Groovy 1.8<br /> Use <code>-groovy.compiler.level 17</code> to specify Groovy 1.7</p> <p>For example, to start Eclipse with a 1.7 compiler:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> eclipse -data /my/groovy17/workspace -groovy.compiler.level 17 </pre></td></tr></table> <p>Use '18' to specify the 1.8 compiler.</p></td></tr></table> <p>See <a class="confluence-link" href="/display/GROOVY/Compiler+Switching+within+Groovy-Eclipse" data-linked-resource-id="133923519" data-linked-resource-type="page" data-linked-resource-default-alias="Compiler Switching within Groovy-Eclipse" data-base-url="http://docs.codehaus.org">Compiler Switching within Groovy-Eclipse</a> and <a href="http://issuetracker.springsource.com/browse/STS-1844">STS-1844</a> for more information.</p> <h3>Enhanced Maven support</h3> <p>We have released, 2.5.2-01 of the groovy-eclipse-compiler. Additionally, the Groovy-Eclipse configurator for m2e v1.0 is now available from the release update site. Full documentation on Groovy-Eclipse's maven support is available at <a class="confluence-link" href="/display/GROOVY/Groovy-Eclipse+compiler+plugin+for+Maven" data-linked-resource-id="193888332" data-linked-resource-type="page" data-linked-resource-default-alias="Groovy-Eclipse compiler plugin for Maven" data-base-url="http://docs.codehaus.org">Groovy-Eclipse compiler plugin for Maven</a>.</p> <h5>groovy-eclipse-compiler plugin for Maven</h5> <p>There have been many improvements to the groovy-eclipse-compiler plugin for Maven. In addition to stability and bug fixing, here is what is new and interesting:</p> <ul> <li>Now based off of Groovy 1.8.2 (by default) and 1.7.10 (if specified).</li> <li>The Java compiler is now Java 7 based (from Eclipse JDT 3.7.1).</li> <li>No longer need to use the build helper plugin to specify the <code>src/main/groovy</code> and <code>src/test/groovy</code> source folders. They are added to the build automatically if they exist.</li> <li>Updated groovy-eclipse-compiler archetype project. This archetype is available at: <a class="external-link" href="https://nexus.codehaus.org/content/repositories/snapshots/" rel="nofollow">https://nexus.codehaus.org/content/repositories/snapshots/</a></li> </ul> <h5>M2E support</h5> <p>Groovy-Eclipse's m2e configurator now works with m2e 1.0 and is also available from the release update site. The old version of the Groovy-Eclipse configurator is still available from the dev update site and we will keep it available for legacy reasons. It is the only version that is compatible with pre 1.0 versions of m2eclipse. However, we recommend against using it if possible.</p> <h3>User Contributed Inferencing Suggestions </h3> <p>There is now another way to extend Groovy-Eclipse's inferencing engine. Using quick assists and a preferences page, users can now contribute dynamic properties and methods to existing classes for a customized editing experience.</p> <p>As seen in the image below it is now possible to invoke a Quick-Assist (CTRL-1 or CMD-1 on Mac) in order to invoke the <em>suggestions dialog</em>. In this example, an unresolved property called <code>getContentDescription</code> in the declaring type <code>java.util.ArrayList</code> is referenced in a Groovy script. The user then presses CTRL+1 on the editor selection and can add the property via the "Add Groovy suggestion" quick assist.</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/inferencing_2.jpg?version=1&modificationDate=1369490253096" data-image-src="/download/attachments/231080203/inferencing_2.jpg?version=1&modificationDate=1369490253096" data-linked-resource-id="231376159" data-linked-resource-type="attachment" data-linked-resource-default-alias="inferencing_2.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > inferencing_2.jpg"></p> <p>The Groovy Suggestions dialogue then opens, pre-populated with values related to the current selection, like the declaring type, property name and type.</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/inferencing_3.jpg?version=1&modificationDate=1369490253084" data-image-src="/download/attachments/231080203/inferencing_3.jpg?version=1&modificationDate=1369490253084" data-linked-resource-id="231376158" data-linked-resource-type="attachment" data-linked-resource-default-alias="inferencing_3.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > inferencing_3.jpg"></p> <p>The user can add additional information like doc hovers, or change the suggestion from a property to a method and add parameters.</p> <p>Once the dialogue is closed, the suggestion is added to the Groovy inferencing engine and the property will now be resolved. The user can add further suggestions, edit or remove existing ones, in the Preferences -> Groovy -> Inferencing preferences page. Additionally, a user can activate or deactivate a suggestion by clicking a check box. Deactivating a suggestion does not remove the suggestion from the list of suggestions for the project, but any references for that suggestion will be unresolved until the user activates it again.</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/inferencing_4.jpg?version=1&modificationDate=1369490253074" data-image-src="/download/attachments/231080203/inferencing_4.jpg?version=1&modificationDate=1369490253074" data-linked-resource-id="231376157" data-linked-resource-type="attachment" data-linked-resource-default-alias="inferencing_4.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > inferencing_4.jpg"></p> <p>Suggestions are persisted in the <code>.groovy/suggestions.xdsl</code> file at the root of all Groovy projects. Each Groovy project has it's own<br /> <code>suggestions.xdsl</code> and so they can be persisted in version control for the project. As of 2.5.2, this feature only supports edits of this file through the preference page or suggestions dialogue. Manual edits of the file are not yet supported. </p> <p>The suggestions dialogue performs type validation where appropriate, as seen in the following screen shot.</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/inferencing_6.jpg?version=1&modificationDate=1369490253051" data-image-src="/download/attachments/231080203/inferencing_6.jpg?version=1&modificationDate=1369490253051" data-linked-resource-id="231376155" data-linked-resource-type="attachment" data-linked-resource-default-alias="inferencing_6.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > inferencing_6.jpg"></p> <p>Any suggestions added to a project that are active also appear in content assist, as seen below where getContentDescription appears as an<br /> option in content assist:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/inferencing_7.jpg?version=1&modificationDate=1369490253064" data-image-src="/download/attachments/231080203/inferencing_7.jpg?version=1&modificationDate=1369490253064" data-linked-resource-id="231376156" data-linked-resource-type="attachment" data-linked-resource-default-alias="inferencing_7.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > inferencing_7.jpg"></p> <h3>Inferencing improvements</h3> <p>We have added many enhancements with the Groovy-Eclipse inferencing engine. A list of all inferencing issues addressed <a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+GRECLIPSE+AND+fixVersion+%3D+17434+AND+component+%3D+%22Inferencing+Engine%22+AND+status+in+%28Resolved%2C+Closed%29+ORDER+BY+priority+DESC">is available here</a>.</p> <p>Here are the highlights.</p> <h5>Better DGM inferencing</h5> <p>Default Groovy Methods now have better inferencing inside of associated closure blocks. For example, the <code>unique</code> DGM method now supports inferencing of the parameter on its closure:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dgm_unique.png?version=1&modificationDate=1369490253238" data-image-src="/download/attachments/231080203/dgm_unique.png?version=1&modificationDate=1369490253238" data-linked-resource-id="231376173" data-linked-resource-type="attachment" data-linked-resource-default-alias="dgm_unique.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dgm_unique.png"></p> <p>In addition to <code>unique</code>, all methods inside the <code>DefaultGroovyMethods</code> class now support inferencing on parameters in closures where appropriate. A complete list is available in <a href="http://jira.codehaus.org/browse/GRECLIPSE-1143">GRECLIPSE-1143</a>.</p> <h5>Type inferencing of DGM methods with non-collection arguments</h5> <p>Now, when non-collections types are targets of DGM methods, the iterator variable type is correctly inferred: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/non-collection-dgm.png?version=1&modificationDate=1369490253144" data-image-src="/download/attachments/231080203/non-collection-dgm.png?version=1&modificationDate=1369490253144" data-linked-resource-id="231376166" data-linked-resource-type="attachment" data-linked-resource-default-alias="non-collection-dgm.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > non-collection-dgm.png"></p> <h5>Other implicit category classes</h5> <p>Support for the implicit category classes <code>DateGroovyMethods</code>, <code>SwingGroovyMethods</code>, <code>XmlGroovyMethods</code>, and <code>ProcessGroovyMethods</code>.<br /> These classes are now handled just like <code>DefaultGroovyMethods</code> in terms of content assist, hovers, and navigation.</p> <p>For example:</p> <p><code>XmlGroovyMethods</code>:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/xgm.png?version=1&modificationDate=1369490253324" data-image-src="/download/attachments/231080203/xgm.png?version=1&modificationDate=1369490253324" data-linked-resource-id="231376174" data-linked-resource-type="attachment" data-linked-resource-default-alias="xgm.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > xgm.png"></p> <p><code>ProcessGroovyMethods</code>:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/pgm.png?version=1&modificationDate=1369490253333" data-image-src="/download/attachments/231080203/pgm.png?version=1&modificationDate=1369490253333" data-linked-resource-id="231376175" data-linked-resource-type="attachment" data-linked-resource-default-alias="pgm.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > pgm.png"></p> <p>For more information, see <a href="http://jira.codehaus.org/browse/GRECLIPSE-1131">GRECLIPSE-1131</a>, <a href="http://jira.codehaus.org/browse/GRECLIPSE-1143">GRECLIPSE-1143</a>, <a href="http://jira.codehaus.org/browse/GRECLIPSE-1145">GRECLIPSE-1145</a>, <a href="http://jira.codehaus.org/browse/GRECLIPSE-1153">GRECLIPSE-1153</a>, <a href="http://jira.codehaus.org/browse/GRECLIPSE-1154">GRECLIPSE-1154</a> and <a href="http://jira.codehaus.org/browse/GRECLIPSE-1155">GRECLIPSE-1155</a>.</p> <h5>Multiple assignment statements</h5> <p>The types of variables assigned in multi-assignment statements are now discovered during inferencing. For example, when assigning a list to multiple variables, the static type of the list elements will be assigned to each variable:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/multi-assign1.png?version=1&modificationDate=1369490253430" data-image-src="/download/attachments/231080203/multi-assign1.png?version=1&modificationDate=1369490253430" data-linked-resource-id="231376176" data-linked-resource-type="attachment" data-linked-resource-default-alias="multi-assign1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > multi-assign1.png"></p> <p>Also, when a method returns a list or array, the type parameter or component type is used as the type of assigned variabled:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/multi-assign2.png?version=1&modificationDate=1369490253453" data-image-src="/download/attachments/231080203/multi-assign2.png?version=1&modificationDate=1369490253453" data-linked-resource-id="231376177" data-linked-resource-type="attachment" data-linked-resource-default-alias="multi-assign2.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > multi-assign2.png"></p> <p>For more information, see <a href="http://jira.codehaus.org/browse/GRECLIPSE-1140">GRECLIPSE-1140</a> and <a href="http://jira.codehaus.org/browse/GRECLIPSE-1136">GRECLIPSE-1136</a>.</p> <h5>Spread-dot type inferencing</h5> <p>The spread-dot operator is now correctly handled by the inferencing engine:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/spread_dot.png?version=1&modificationDate=1369490253141" data-image-src="/download/attachments/231080203/spread_dot.png?version=1&modificationDate=1369490253141" data-linked-resource-id="231376165" data-linked-resource-type="attachment" data-linked-resource-default-alias="spread_dot.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > spread_dot.png"></p> <h5>Match operator inferencing</h5> <p>Match operator expressions now support inferencing:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/match_operator.png?version=1&modificationDate=1369490253461" data-image-src="/download/attachments/231080203/match_operator.png?version=1&modificationDate=1369490253461" data-linked-resource-id="231376178" data-linked-resource-type="attachment" data-linked-resource-default-alias="match_operator.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > match_operator.png"></p> <p>For more information, see <a href="http://jira.codehaus.org/browse/GRECLIPSE-1159">GRECLIPSE-1159</a>.</p> <h3>DSL Support</h3> <p>We are continuing to improve on our DSL support in Groovy-Eclipse through our DSL descriptors. Below are the significant enhancements. And all enhancements are described in more detail in <a class="confluence-link" href="/display/GROOVY/DSL+Descriptors+for+Groovy-Eclipse" data-linked-resource-id="204275718" data-linked-resource-type="page" data-linked-resource-default-alias="DSL Descriptors for Groovy-Eclipse" data-base-url="http://docs.codehaus.org">DSL Descriptors for Groovy-Eclipse</a>.</p> <h5><code>namedParams</code> and <code>optionalParams</code> for method contributions</h5> <p>It is now possible to distinguish between regular, named, and optional parameters in DSLD method contributions. Regular parameters are always filled in when performing content assist for the method and they are not prefixed by a name. Named parameters are prefixed by a name and are also always filled in during content assist. And they are placed after all the regular parameters. Lastly, optional parameters are not filled in via content assist of the method. Instead, optional parameters are only available for content assist of named parameters. All parameters are visible during hovers.</p> <p>Here is an example to make this clear. Consider the following simple DSLD file that adds editing support for the static <code>create</code> method to the <code>Person</code> class: </p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> currentType("Person").accept { method name:"create", type:"Person", params:[id:Long], namedParams:[firstName:String, lastName:String], optionalParams:[age:Integer], isStatic:true, provider:"Person DSL" } </pre></td></tr></table> <p>The method contribution defines params, namedParams, and optionalParams. The first thing to see is that when doing content assist, only the regular and named parameters will be shown:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dsld1.png?version=1&modificationDate=1369490253148" data-image-src="/download/attachments/231080203/dsld1.png?version=1&modificationDate=1369490253148" data-linked-resource-id="231376167" data-linked-resource-type="attachment" data-linked-resource-default-alias="dsld1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dsld1.png"></p> <p>And when applying that proposal, only those parameters are displayed (the first parameter is regular, and the second two are named): </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dsld2.png?version=1&modificationDate=1369490253150" data-image-src="/download/attachments/231080203/dsld2.png?version=1&modificationDate=1369490253150" data-linked-resource-id="231376168" data-linked-resource-type="attachment" data-linked-resource-default-alias="dsld2.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dsld2.png"></p> <p>The optional parameters are shown in hovers (along with all other parameters): </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dsld3.png?version=1&modificationDate=1369490253151" data-image-src="/download/attachments/231080203/dsld3.png?version=1&modificationDate=1369490253151" data-linked-resource-id="231376169" data-linked-resource-type="attachment" data-linked-resource-default-alias="dsld3.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dsld3.png"></p> <p>They can also be seen in content assist, when named parameters would be visible: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dsld4.png?version=1&modificationDate=1369490253153" data-image-src="/download/attachments/231080203/dsld4.png?version=1&modificationDate=1369490253153" data-linked-resource-id="231376170" data-linked-resource-type="attachment" data-linked-resource-default-alias="dsld4.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dsld4.png"></p> <p>Note that the editor is smart enough to only show parameter proposals if that parameter doesn't already exist, so if we remove the <code>lastName</code> named parameter and do content assist, it will show up as a proposal: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/dsld5.png?version=1&modificationDate=1369490253161" data-image-src="/download/attachments/231080203/dsld5.png?version=1&modificationDate=1369490253161" data-linked-resource-id="231376171" data-linked-resource-type="attachment" data-linked-resource-default-alias="dsld5.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > dsld5.png"></p> <h3>Content assist improvements</h3> <h5>Named parameter content assist</h5> <p>Methods that expect named parameters (typically specified in a DSL descriptor, see above) can have their named parameters filled in via content assist, as shown in this screenshot: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/named_param_content_assist.png?version=1&modificationDate=1369490253125" data-image-src="/download/attachments/231080203/named_param_content_assist.png?version=1&modificationDate=1369490253125" data-linked-resource-id="231376163" data-linked-resource-type="attachment" data-linked-resource-default-alias="named_param_content_assist.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > named_param_content_assist.png"></p> <p>Notice in the screenshot that there are 3 named parameters displayed: firstName, lastName, and age. These are defined in a <a href="http://blog.springsource.com/2011/05/08/better-dsl-support-in-groovy-eclipse/">DSL descriptor </a>in the project.</p> <p>As with selecting method proposals during content assist, Groovy-Eclipse will try to find reasonable values to fill in when selecting a named parameter: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/named_parameter_guessing.png?version=1&modificationDate=1369490253136" data-image-src="/download/attachments/231080203/named_parameter_guessing.png?version=1&modificationDate=1369490253136" data-linked-resource-id="231376164" data-linked-resource-type="attachment" data-linked-resource-default-alias="named_parameter_guessing.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > named_parameter_guessing.png"></p> <p>There is a caveat. Named parameter proposals will not appear in the proposal list if there is a prefix already typed. So, in the following example, there will be no named parameters proposed since the prefix 'f' already exists: </p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/no_named_parameters.png?version=1&modificationDate=1369490253121" data-image-src="/download/attachments/231080203/no_named_parameters.png?version=1&modificationDate=1369490253121" data-linked-resource-id="231376162" data-linked-resource-type="attachment" data-linked-resource-default-alias="no_named_parameters.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > no_named_parameters.png"></p> <h5>Method context information</h5> <p>Groovy-Eclipse now follows the JDT convention of displaying context information for methods when invoking content assist inside of a method call and there is no prefix. For example, when invoking content assist just after an opening paren, you are only shown a list of known ways to invoke the target method:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/context_info1.png?version=1&modificationDate=1369490253478" data-image-src="/download/attachments/231080203/context_info1.png?version=1&modificationDate=1369490253478" data-linked-resource-id="231376179" data-linked-resource-type="attachment" data-linked-resource-default-alias="context_info1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > context_info1.png"></p> <p>Selecting one of the proposals will show that method's information in tooltips above the caret location:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/context_info2.png?version=1&modificationDate=1369490253494" data-image-src="/download/attachments/231080203/context_info2.png?version=1&modificationDate=1369490253494" data-linked-resource-id="231376180" data-linked-resource-type="attachment" data-linked-resource-default-alias="context_info2.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > context_info2.png"></p> <p>Similarly, invoking content assist after a comma will show context information as well:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/context_info3.png?version=1&modificationDate=1369490253498" data-image-src="/download/attachments/231080203/context_info3.png?version=1&modificationDate=1369490253498" data-linked-resource-id="231376181" data-linked-resource-type="attachment" data-linked-resource-default-alias="context_info3.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > context_info3.png"></p> <p>For more information, see <a href="http://jira.codehaus.org/browse/GRECLIPSE-674">GRECLIPSE-674</a>.</p> <h5>Content assist now recognizes closure parameters</h5> <p>When a field has a closure for an initializer, content assist will now reflect this and show method proposal variants for the field:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/closure_field.png?version=1&modificationDate=1369490253502" data-image-src="/download/attachments/231080203/closure_field.png?version=1&modificationDate=1369490253502" data-linked-resource-id="231376182" data-linked-resource-type="attachment" data-linked-resource-default-alias="closure_field.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > closure_field.png"></p> <p>For more information, see <a href="http://jira.codehaus.org/browse/GRECLIPSE-1139">GRECLIPSE-1139</a>.</p> <h3>Static type checking (experimental)</h3> <p>Groovy-Eclipse 2.5.2 ships with an experimental way to perform static type checking on your Groovy projects. There is a new menu category that appears whenever any Groovy files, packages, or projects are selected:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/static_checking1.png?version=1&modificationDate=1369490253120" data-image-src="/download/attachments/231080203/static_checking1.png?version=1&modificationDate=1369490253120" data-linked-resource-id="231376161" data-linked-resource-type="attachment" data-linked-resource-default-alias="static_checking1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > static_checking1.png"></p> <p>When invoking this command, all groovy files currently selected will be type checked (i.e., sent to the inferencing engine). Warning markers are added to any expressions that would be otherwise underlined in the editor:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/static_checking2.png?version=1&modificationDate=1369490253166" data-image-src="/download/attachments/231080203/static_checking2.png?version=1&modificationDate=1369490253166" data-linked-resource-id="231376172" data-linked-resource-type="attachment" data-linked-resource-default-alias="static_checking2.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > static_checking2.png"></p> <p>If you want to remove all of the type check warnings simply select "Remove checks" from the "Groovy Type Checking" menu while selecting the files you want to clean.</p> <p>You can also add some type assertions to ensure that the static type of an expression is correctly determined by the inferencing engine (this is particularly useful for testing your DSLs):</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/static_checking3.png?version=1&modificationDate=1369490253111" data-image-src="/download/attachments/231080203/static_checking3.png?version=1&modificationDate=1369490253111" data-linked-resource-id="231376160" data-linked-resource-type="attachment" data-linked-resource-default-alias="static_checking3.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > static_checking3.png"></p> <p>This feature is still experimental and we are looking for feedback on it. If you find this feature useful, if you have any suggestions for it, or if you have found problems with it, please contact us on mailing list to discuss.</p> <h3>Remove trailing whitespace and semi-colons save actions</h3> <p>It is now possible to configure Groovy-Eclipse to automatically remove trailing whitespace and semi-colons on file-save. Go to Preferences -> Groovy -> Save actions to enable it:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/save_action1.png?version=1&modificationDate=1369490253042" data-image-src="/download/attachments/231080203/save_action1.png?version=1&modificationDate=1369490253042" data-linked-resource-id="231376154" data-linked-resource-type="attachment" data-linked-resource-default-alias="save_action1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > save_action1.png"></p> <p>It is also necessary to enable save actions for Java editors, which you can do can do by going to Preferences -> Java -> Editor -> Save actions:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/save_action1a.png?version=1&modificationDate=1369490253030" data-image-src="/download/attachments/231080203/save_action1a.png?version=1&modificationDate=1369490253030" data-linked-resource-id="231376153" data-linked-resource-type="attachment" data-linked-resource-default-alias="save_action1a.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > save_action1a.png"></p> <p>Enabling the save action will convert this file:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/save_action2.png?version=1&modificationDate=1369490253021" data-image-src="/download/attachments/231080203/save_action2.png?version=1&modificationDate=1369490253021" data-linked-resource-id="231376152" data-linked-resource-type="attachment" data-linked-resource-default-alias="save_action2.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > save_action2.png"></p> <p>into this file:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/save_action3.png?version=1&modificationDate=1369490253005" data-image-src="/download/attachments/231080203/save_action3.png?version=1&modificationDate=1369490253005" data-linked-resource-id="231376151" data-linked-resource-type="attachment" data-linked-resource-default-alias="save_action3.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > save_action3.png"></p> <p>after a save.</p> <h3>Editing support for Groovy files outside of the build path</h3> <p>Scripts that are not placed on the build path now provide many of the standard editing features that is used by scripts on the build path, such as content assist, type inferencing, and mark occurrences. The classpath for the script is assumed to be the same build path as the one for the rest of the project.</p> <p>Note that missing import references will not be reported, and references in scripts will not show in search results, nor will refactoring work in these files.</p> <h3>Fix import statements after move/copy</h3> <p>Import statements are now properly cleaned up after a move or copy of a Groovy file to a new location. See <a href="http://jira.codehaus.org/browse/GRECLIPSE-682">GRECLIPSE-682</a> for more information.</p> <h3>More precise searching for overloaded methods</h3> <p>The number of parameters of method declarations are now used to more precisely determine the actual declaration of a method reference:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/method_search1.png?version=1&modificationDate=1369490253506" data-image-src="/download/attachments/231080203/method_search1.png?version=1&modificationDate=1369490253506" data-linked-resource-id="231376183" data-linked-resource-type="attachment" data-linked-resource-default-alias="method_search1.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > method_search1.png"></p> <p>See <a href="http://jira.codehaus.org/browse/GRECLIPSE-1138">GRECLIPSE-1138</a> for more information.</p> <h3>More precise rename refactoring of overloaded methods</h3> <p>This new technique for method searching is used to ensure that overloaded methods do not interfere with rename refactoring:</p> <p><img class="confluence-embedded-image confluence-content-image-border image-center" src="/download/attachments/231080203/rename_overloaded.png?version=1&modificationDate=1369490253514" data-image-src="/download/attachments/231080203/rename_overloaded.png?version=1&modificationDate=1369490253514" data-linked-resource-id="231376184" data-linked-resource-type="attachment" data-linked-resource-default-alias="rename_overloaded.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080203" title="null > rename_overloaded.png"></p> <h3>Compatibility</h3> <p>Groovy-Eclipse 2.5.2 includes Groovy 1.7.10 by default. <a class="confluence-link" href="/display/GROOVY/Compiler+Switching+within+Groovy-Eclipse" data-linked-resource-id="133923519" data-linked-resource-type="page" data-linked-resource-default-alias="Compiler Switching within Groovy-Eclipse" data-base-url="http://docs.codehaus.org">Groovy 1.8.2 can be optionally installed.</a> This version of Groovy-Eclipse is recommended to be installed on STS 2.7.2, 2.8.0.M2, Eclipse 3.7.0, 3.7.1, 3.6.0, 3.6.1, or 3.6.2. There are different update sites for Groovy-Eclipse targeting Eclipse 3.6 and 3.7 (see above).</p> <h3>Bug fixes</h3> <p>We have fixed over 100 bugs for this release. See the details on our <a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+GRECLIPSE+AND+fixVersion+%3D+17434+AND+status+%3D+Resolved">issue tracker</a>.</p> <h3>Shout outs</h3> <p>We've received quite a bit of help with this release from the community, especially with the maven support. So, a special thank you to:</p> <ul> <li>Travis Schneeberger for work on maven integration, helping to test snapshot versions, and providing suggestions on how to fix bugs.</li> <li>Bob Tiernay for being thorough and checking through all of our type inferencing for DefaultGroovyMethods for anything we missed (and there was a lot).</li> <li>Rene Scheibe for his work on the <em>Save action</em> to remove whitespace and semi-colons.</li> <li>Benson Margulies for helping to migrate the Groovy-Eclipse m2e configurator to support m2e version 1.0. I could not have done this one alone.</li> </ul> <p>And of course, thank you to everyone else who raised bugs on jira and asked questions on the mailing lists.</p> <h3>What's next?</h3> <p>We appreciate all community support and feedback. If you wish to join the discussion about Groovy-Eclipse then please sign up for the <a href="http://xircles.codehaus.org/manage_email/eclipse-plugin-user@groovy.codehaus.org">mailing list</a>. For any issues you have (or enhancements you would like to see), please raise them in our <a href="http://jira.codehaus.org/browse/GRECLIPSE">issue tracker</a>. If there is an existing bug fix or enhancement that you require are not seeing any movement on, please make some noise on it (and get your friends to do the same). We respond to community feedback, and we can make the most improvements to Groovy-Eclipse when we hear directly from the community. So, please speak up!</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced