Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
Yes, that did the trick, thanks!
Re: how to customize the XtextBuilder [message #1815337 is a reply to message #1009557] Tue, 01 October 2019 02:14 Go to previous messageGo to next message
Eclipse UserFriend
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 11:16 Go to previous message
Eclipse UserFriend
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
Previous Topic:Polymorphic Cross-Reference
Next Topic:Xtend as a End User Template?
Goto Forum:
  


Current Time: Tue Mar 25 03:01:18 EDT 2025

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

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

Back to the top