Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Custom formatter not registred
Custom formatter not registred [message #1782724] Wed, 28 February 2018 13:42 Go to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 200
Registered: August 2013
Senior Member
Hi

I added the following into my mwe2:

formatter = {
generateXtendStub = false
}

A custom formatter class is generated:

class <MyDSL>Formatter extends AbstractFormatter2

But it's not registred in Abstract<MyDSL>RuntimeModule. How to register it? I can override only bindIFormatter. There is no bindIFormatter2 in RuntimeModule class
Re: Custom formatter not registred [message #1782726 is a reply to message #1782724] Wed, 28 February 2018 13:45 Go to previous messageGo to next message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 200
Registered: August 2013
Senior Member
Ooops. I mean generateXtendStub = true
Re: Custom formatter not registred [message #1782727 is a reply to message #1782726] Wed, 28 February 2018 14:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12038
Registered: July 2009
Senior Member
you can add any binding you want. no need for overriding.

formatter = {
generateStub = true
}

should do the trick. and add a binding automaticaly

can you please create a bug at github.com/eclipse/xtext-core

about generateXtendStub not working


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Custom formatter not registred [message #1782729 is a reply to message #1782727] Wed, 28 February 2018 14:43 Go to previous message
Denis Nikiforov is currently offline Denis NikiforovFriend
Messages: 200
Registered: August 2013
Senior Member
Thanks!

I've added the folowing into <MyDSL>RuntimeModule
    def Class<? extends IFormatter2> bindIFormatter2() {
        <MyDSL>Formatter
    }


And it works! Maybe it will be helpful for somebody: return type must be specified explicitly.

Here is a bug: https://github.com/eclipse/xtext-core/issues/646
Previous Topic:Xbase: Organize imports removes imported model packages
Next Topic:How to globally disable addition of spaces between keywords?
Goto Forum:
  


Current Time: Thu Jun 21 13:58:39 GMT 2018

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

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

Back to the top