Monday, October 26, 2009

Acceleo template editor latest improvements

We try and constantly improve the Acceleo template editor as much as we can so as to make it as intuitive as possible. I haven't posted anything here about the template editing, here is a brief recapitulation of the features we're supporting (apart from the basic functions inherited from the text editor such as search, incremental search, ...). Including the latests and in no particular order :

  • Syntax highlighting
A classic for any self-respecting code editor, Acceleo provides highlighting for all module elements, though highlighting is minimal for OCL elements.
  • Error detection
Once again, a classic for any editor which contents are compiled, interpreted, or in any way error-prone.
  • Quick fix (ctrl+shift+1)
Not much accessible in terms of quick fixes yet, Acceleo only provides the possibility to create templates or queries corresponding to "not found" compilation errors.
  • Completion (ctrl+space)
We provide code completion for templates, queries, operations and OCL standard elements.
  • Open declaration (ctrl+click ; F3)
Sorry, no fancy screenshot on this one, as I don't know how to make a meaningful one :p. Anyone familiar with Eclispe's Java editor knows this one; it basically allows you to find the declaration of any variable, type, operation, ... by a single click on its usage within the code. This allows navigation to and from other Acceleo templates, and to the metamodel when calling it on a metatype.
  • Quick outline (ctrl+o)
This allows users to quickly assess the size of a given module, find a query or template defined in it and navigate to it through a few clicks. Note that this doesn't show as much information as the regular outline view, since it is only designed to outline the module's architecture.
  • Search references (ctrl+shift+g)
Still needs some polishing to only find references in the accurate scope, yet this already allows users to find references to the selected variable or template.
  • Code folding
Granted, a screenshot is somewhat cryptic for this feature if you do not already know what code folding is. Basically, blocks of code (in Acceleo, comments, templates and queries) can be folded so that they only take two lines. If you look carefully at the screenshot below, you'll notice the "+" on the left edge right to the line numbers "4" and "8" ... as well as the fact we're missing lines 5 and 9; well, those two templates are folded :p.

More features will be included in the editor as there's a bunch of cool features that can be added to simplify template editing; next are the refactoring facilities \o/.

Thursday, October 1, 2009

Generate code with the right encoding

Up until now, Acceleo allowed you to define the encoding in which the module itself should be read in the form of a comment at the very beginning of the module :However, this only affects how Acceleo reads your template file; it will not affect how Acceleo generates files from this module. So if you want to generate an XML file, and this XML file needs be encoded in a specific encoding which is not you system's default, you're stuck :p. Or at least that was true until M2.

Let's take this basic module as an example :This simple module is entirely composed of static text; its only purpose is to generate an ant file that creates a zip from a directory in a directory named "échantillons"... yes, that's an "é". If This file is generated under windows, no problem : the default windows encoding is the same as ISO-8859-1 as far as the "é" is concerned. What if this file is generated by one of your coworker who happens to be working under linux? Here's what would be generated :
And that'd could be a tragedy if the error isn't seen before someone tries and run this ant build... and sees that you generated under something else that windows! Imagine all the chocolate needed to atone for that blasphemy! Acceleo now proposes a way to define once and for all the encoding that must be used to generate a given file, and all you need is a single parameter for the file block :Take note that this is not a behaviour described by the OMG MOFM2T specification (that sadly left all encoding issues aside). As suche this feature might change form in the future, monitor the related OMG issue if you're interested by this field.

Wednesday, July 1, 2009

Acceleo 0.8 is out

You might already know Acceleo 2.6, the open source model-to-text generator, and wonder how version 2.6 could come down to 0.8. The reason is quite simple : after four years of development outside of Eclipse, Acceleo is now taking a turn (for the better we hope :)) since we began rewriting it within Eclipse as the implementation of the OMG MOF Model to text Transformation Language (MOFM2T) specification. This change and our becoming an Eclipse-hosted project calls for a mandatory incubation period, thus version numbers "0.x".

Acceleo 0.8 already offers basic solutions to migrate existing Acceleo 2.x templates to the new syntax. This migration is still a draft and we are working on improving it so that most "old" templates can be migrated to the new syntax automatically, or with the least amount of manual editing needed. Compatibility with Eclipse itself is detailed on Acceleo wiki page.

This first release of Acceleo as the implementation of the MOFM2T specification already provides most of the tooling that can be expected from an M2T generator. A succinct list can be found on the New and noteworthy wiki page.

Tuesday, June 30, 2009

EMF Compare graduated!

Galileo is out ... and with it came the graduation of EMF Compare to 1.0 at last!

A great deal of improvement has been made in EMF Compare so as to improve user experience and effectiveness. This release sees the usual new differences EMF Compare detects (reference order changes, resource dependencies, ...), and an improved support for the various VCSs (CVS, SVN, ...).

The most outstanding improvement is the ability to compare whole ResourceSets instead of a single model; allowing users to compare fragmented models as well as linked models (UML models referring to profiles, Genmodels referring to ecore models, ...) and thus detecting changes made in the selected models along with changes that can have taken place in their dependencies.


Thanks to a contribution from Moritz Eysholdt, EMF Compare now provides a patch format for model merging. This EPatch format is associated with a textual syntax thanks to XText, allowing for easier editing and improved readability of these patches.


The full list is available on EMF Compare 1.0 new and noteworthy wiki page.

Friday, February 20, 2009

Negative search

Dimitrios Kolovos posted a while ago a plugin to allow negative searches within Eclipse (how to find a file that does not contain a given String). I didn't want to install yet another plugin in my Eclipse and thought that regexes should allow for this.

Well they do :) here's a regex that will match any file if it does not contain "Copyright" (can be quite useful, that :p).

(?s)\A((?!Copyright).)*\Z

Monday, February 9, 2009

no more unresolvable EMF Compare failures

Ever tried using EMF Compare to compare your models only to see it fail somehow? Metamodels often evolve, making the old models unusable. Sometimes the models themselves aren't valid and cannot be loaded through EMF. On such occasion, trying to compare the files through EMF Compare simply failed, opening a blank editor and logging an exception.

That left you with no way to compare your files, save for renaming them to another extension. Well fear no more! As of 0.9M3, EMF Compare now displays a pretty error message when something goes wrong while loading the models.
Apart from frustrating you with this all too often seen red icon, this dialog provides you with the option to compare the files as text. Oh goodie!
Well of course, xmi isn't really a human-friendly language ... but at least this is way better than nothing to spot that stupid typo and make the model useable again :).