Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to bind Formatter2
How to bind Formatter2 [message #1743228] Tue, 13 September 2016 12:42 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi all,

when I create new modules or import existing ones using a Sirius editor the resulting model file is not formatted.

I guess this is a relict from migrating to Xtext 2.10. Thus I checked the runtime module class and found no binding for this class.

in DefaultRuntimeModule there is only a binding for IFormatter:

	public Class<? extends IFormatter> bindIFormatter() {
		return OneWhitespaceFormatter.class;
	}


Where/how is the IFormatter2 binding done?
Re: How to bind Formatter2 [message #1743229 is a reply to message #1743228] Tue, 13 September 2016 12:53 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Just saw that org.eclipse.xtend.core has no binding for it's formatter, too. So there is apparently another way to expose the formatter of a language.
Re: How to bind Formatter2 [message #1743234 is a reply to message #1743229] Tue, 13 September 2016 13:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
you can simply add


formatter {
generateStub=true
}

to the workflow


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to bind Formatter2 [message #1743252 is a reply to message #1743234] Tue, 13 September 2016 15:15 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
This was the solution. Thanks Christian!
Re: How to bind Formatter2 [message #1743269 is a reply to message #1743252] Tue, 13 September 2016 16:53 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
You can also specify generateXtendStub

Previous Topic:XText suggests left-factoring. Why?
Next Topic:xtext discouraged access warning
Goto Forum:
  


Current Time: Thu Apr 25 01:27:53 GMT 2024

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

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

Back to the top