Skip to main content


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 10:07 Go to next message
Tom Brus is currently offline Tom BrusFriend
Messages: 26
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 10:45 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
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 11:02 Go to previous messageGo to next message
Tom Brus is currently offline Tom BrusFriend
Messages: 26
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 12:47 Go to previous messageGo to next message
Tom Brus is currently offline Tom BrusFriend
Messages: 26
Registered: February 2011
Junior Member
Yes, that did the trick, thanks!
Re: how to customize the XtextBuilder [message #1815337 is a reply to message #1009557] Tue, 01 October 2019 06:14 Go to previous messageGo to next message
Prerana Doshi is currently offline Prerana DoshiFriend
Messages: 7
Registered: October 2019
Junior Member
I am also facing the same issue when tried to customize XtextBuilder. In my scenario the builder participant wont work. I have extended the XtextBuilder similarly as mentioned in the first update by Tom. Has anyone solved the below issue.

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)
Re: how to customize the XtextBuilder [message #1815425 is a reply to message #1815337] Wed, 02 October 2019 15:16 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
You need to use the overriding guice module extension point for that
https://www.eclipse.org/forums/index.php?t=msg&th=628267&goto=1220402&#msg_1220402

Please note: this will affect all Xtext Languages


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Polymorphic Cross-Reference
Next Topic:Xtend as a End User Template?
Goto Forum:
  


Current Time: Fri Apr 26 09:19:08 GMT 2024

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

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

Back to the top