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: 346
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: 346
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: 14716
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


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: 346
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: Tue Sep 24 19:04:23 GMT 2024

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

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

Back to the top