Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore model generator - use tab or white spaces for indentation
Ecore model generator - use tab or white spaces for indentation [message #1691646] Wed, 08 April 2015 17:10 Go to next message
Silvestre Martins is currently offline Silvestre MartinsFriend
Messages: 84
Registered: July 2009
Member
We have a strange behavior, in some workspaces the generated code uses tabs for indentation, in other workspaces it uses white spaces.
We are using the codegen libraries from Eclipse Luna 4.4.1.

Where is this configured? Does it reuse some setting from the Eclipse IDE? Or can I force to use always the same setting when generating the code from the IDE?

I already switched between different formatters in the Eclipse preferences (with tabs only and spaces only) and it has no effect.

[Updated on: Wed, 08 April 2015 17:12]

Report message to a moderator

Re: Ecore model generator - use tab or white spaces for indentation [message #1691648 is a reply to message #1691646] Wed, 08 April 2015 17:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6450
Registered: July 2009
Senior Member
Am 08.04.2015 um 19:11 schrieb Silvestre Martins:
> We have a strange behavior, in some workspaces the generated code uses tabs for indentation, in other workspaces it
> uses white spaces.
> Where is this configured? Does it reuse some setting from the Eclipse IDE? Or can I force to use always the same
> setting when generating the code from the IDE?
>
> I already switched between different formatters in the Eclipse preferences (with tabs only and spaces only) and it has
> no effect.
IIRC., the generator picks up project-specific formatter and cleanup settings (if available). That can lead to different
results in different projects.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Ecore model generator - use tab or white spaces for indentation [message #1691898 is a reply to message #1691648] Fri, 10 April 2015 11:17 Go to previous messageGo to next message
Silvestre Martins is currently offline Silvestre MartinsFriend
Messages: 84
Registered: July 2009
Member
You're right, it seems it uses the formatter settings event if they are not set at the project level (workspace level). My problem was that it was not considering the changes, it seems Eclipse needs to be restarted in order to ensure it refreshes the settings.

It seems the cleanup settings are not used, since I have enabled the "remove unused imports" option and the generated code still have unused imports (this is due to a limitation in our generator templates).

Re: Ecore model generator - use tab or white spaces for indentation [message #1691903 is a reply to message #1691898] Fri, 10 April 2015 11:33 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6450
Registered: July 2009
Senior Member
Am 10.04.2015 um 13:17 schrieb Silvestre Martins:
> You're right, it seems it uses the formatter settings event if they are not set at the project level (workspace
> level). My problem was that it was not considering the changes, it seems Eclipse needs to be restarted in order to
> ensure it refreshes the settings.
>
> It seems the cleanup settings are not used, since I have enabled the "remove unused imports" option and the generated
> code still have unused imports (this is due to a limitation in our generator templates).
Have you enabled "Source Cleanup" in your GenModel?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Ecore model generator - use tab or white spaces for indentation [message #1691934 is a reply to message #1691903] Fri, 10 April 2015 13:52 Go to previous message
Silvestre Martins is currently offline Silvestre MartinsFriend
Messages: 84
Registered: July 2009
Member
Eike Stepper wrote on Fri, 10 April 2015 07:33
Am 10.04.2015 um 13:17 schrieb Silvestre Martins:
> It seems the cleanup settings are not used, since I have enabled the "remove unused imports" option and the generated
> code still have unused imports (this is due to a limitation in our generator templates).
Have you enabled "Source Cleanup" in your GenModel?


No, I haven't. Good hint!
Thanks!

[Updated on: Fri, 10 April 2015 14:24]

Report message to a moderator

Previous Topic:Serialisation of EMF-Model to XML file takes several hours
Next Topic:The feature is not a valid feature. (java.lang.IllegalArgumentException)
Goto Forum:
  


Current Time: Tue Nov 12 08:34:06 GMT 2019

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

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

Back to the top