Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to customize the XtextBuilder
how to customize the XtextBuilder [message #1009557] Fri, 15 February 2013 05:07 Go to next message
Tom Brus is currently offline Tom Brus
Messages: 25
Registered: February 2011
Junior Member
Hi,

I have a language (Xyzzy) up and running and want to tweak the builder for it.

I subclassed the XtextBuilder to XyzzyBuilder and added the following to XyzzyRuntimeModule:

   public Class<? extends IncrementalProjectBuilder> bindIncrementalProjectBuilder() {
        return XyzzyBuilder.class;
   }

But now I am getting a lot of these errors:

1) No implementation for org.eclipse.core.runtime.IExtensionRegistry was bound.
  while locating org.eclipse.core.runtime.IExtensionRegistry
    for field at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.extensionRegistry(Unknown Source)
  while locating org.eclipse.xtext.builder.impl.RegistryBuilderParticipant
    for field at org.eclipse.xtext.builder.impl.XtextBuilder.participant(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)

1 error

I am not too familiar with Guice yet so I might be forgetting something or doing something stupid. I found Xtext's SharedModule class that seems to play a role here but I have no idea how to make it fly. I even tried this (giving me the same errors):

   public Class<? extends IncrementalProjectBuilder> bindIncrementalProjectBuilder() {
        return XtextBuilder.class; // return original builder !!
   }


Any hints or pointers?

Thanks,
Tom
Re: how to customize the XtextBuilder [message #1009579 is a reply to message #1009557] Fri, 15 February 2013 05:45 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1149
Registered: July 2009
Senior Member
Hi,

do you really want to change the builder for all Xtext languages or wouldn't it suffice to have an IXtextBuilderParticipant for your language?

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: how to customize the XtextBuilder [message #1009593 is a reply to message #1009579] Fri, 15 February 2013 06:02 Go to previous messageGo to next message
Tom Brus is currently offline Tom Brus
Messages: 25
Registered: February 2011
Junior Member
The thing I like to do now is some extra cleaning at clean time (probably more later). I have only one language, so yes I want to add it to all my languages and at the same time no, I only want to changed the builder for my xyzzy language Wink.

I looked at the IXtextBuilderParticipant before and thought it was only called on builds, not on clean. Your remark made me look again and I discovered that the it is also called at clean time, so it might do the trick for me.

Is the IXtextBuilderParticipant the designed way to add functionality to the xtext builder?

I will give it a shot... Thanks for the hint!

Tom
Re: how to customize the XtextBuilder [message #1009646 is a reply to message #1009593] Fri, 15 February 2013 07:47 Go to previous message
Tom Brus is currently offline Tom Brus
Messages: 25
Registered: February 2011
Junior Member
Yes, that did the trick, thanks!
Previous Topic:@Check validations not being executed
Next Topic:No hovers in Fowler's State-Machine
Goto Forum:
  


Current Time: Thu Apr 17 03:34:59 EDT 2014

Powered by FUDForum. Page generated in 0.02751 seconds