Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Protected block indentation problems
[Acceleo] Protected block indentation problems [message #643373] Mon, 06 December 2010 16:50 Go to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Hopefully without posting an example someone will be familiar with this problem.

I applied "post trim" to each of my templates, but even still, every time I re-generate my code, the protected block code gets progressively further indented.

The only way I was able to prevent this from happening was to delete all of the indentations in my mtl code, making it highly unreadable.

Is there something obvious I'm missing, or might this be an Acceleo bug?

Thanks!
Jeff
Re: [Acceleo] Protected block indentation problems [message #643495 is a reply to message #643373] Tue, 07 December 2010 06:55 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

This is a known bug of Acceleo, we try to correct the indentation after the generation and this should not be applied to the protected area. It should be corrected for Acceleo 3.1.

Stephane Begaudeau, Obeo
Re: [Acceleo] Protected block indentation problems [message #643617 is a reply to message #643495] Tue, 07 December 2010 16:27 Go to previous messageGo to next message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
In the meantime, is there an easy way to call JDT's source formatting to beautify the generated code?

Thanks!
Jeff
Re: [Acceleo] Protected block indentation problems [message #643755 is a reply to message #643373] Wed, 08 December 2010 07:52 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

The formatter of the JDT is "org.eclipse.jdt.core.formatter.CodeFormatter". You could try something like this:
http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg2 4101.html
http://stackoverflow.com/questions/2873678/eclipse-jdt-call- correct-indentation-programmatically

Stephane Begaudeau, Obeo.
Re: [Acceleo] Protected block indentation problems [message #643922 is a reply to message #643755] Wed, 08 December 2010 17:27 Go to previous message
Glenview Jeff is currently offline Glenview JeffFriend
Messages: 79
Registered: September 2010
Member
Thanks so much Stephane. I'll give it a shot! I couldn't find these in my searches.

Jeff
Previous Topic:How Increment Variable in loop
Next Topic:How to call JDT source formatting (beautify) after generation
Goto Forum:
  


Current Time: Fri Apr 19 21:21:30 GMT 2024

Powered by FUDForum. Page generated in 0.02943 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top