Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » dynamic template proposals in xtext revisited
dynamic template proposals in xtext revisited [message #1746493] Mon, 31 October 2016 08:17 Go to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
xtext_2.8.4.v201508050135.version:

I tried the suggestions from https://www.eclipse.org/forums/index.php/mv/msg/297566/870958/#msg_870958, (from 2012), but got an error:

0 [Worker-7] ERROR org.xtext.example.mydsl.ui.internal.MyDslActivator - Failed to create injector for org.xtext.example.mydsl.MyDsl
0 [Worker-7] ERROR org.xtext.example.mydsl.ui.internal.MyDslActivator - Guice creation errors:

1) A binding to org.eclipse.xtext.ui.editor.contentassist.ITemplateProposalProvider was already configured at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:56).
at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:56)

1 error
com.google.inject.CreationException: Guice creation errors:

1) A binding to org.eclipse.xtext.ui.editor.contentassist.ITemplateProposalProvider was already configured at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:56).
at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:56)

1 error

Before, I got an error for the @override annotation in the

public class MyDslUiModule extends org.xtext.example.mydsl.ui.AbstractMyDslUiModule {
public MyDslUiModule(AbstractUIPlugin plugin) {
super(plugin);
}
@Override
public Class<? extends ITemplateProposalProvider> bindTemplateProposalProvider() {
return MyTemplateProposalProvider.class;
}
}


So I assume something has changed in the internals of xtext. Perhaps someone can give me a hint what to do to adjust the code; the navigation in the templates is just a too nice feature.

TIA, Uli

[Updated on: Mon, 31 October 2016 08:20]

Report message to a moderator

Re: dynamic template proposals in xtext revisited [message #1746494 is a reply to message #1746493] Mon, 31 October 2016 08:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
it is the method name

@Override
public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider() {
return MyDslTemplateProposalProvider.class;
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: dynamic template proposals in xtext revisited [message #1746495 is a reply to message #1746493] Mon, 31 October 2016 08:28 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
sorry, I found the typo:
should read bindITemplateProposalProvider()

Hi Dietrich, thank you very much for the fast reply.

So the good news:

we can still (2.8 at least) use dynamic templates with xtext DSL in the ContentAssist.
(I asked on xtextcon 2015, if this is possible, but noone pointed me to that solution).

[Updated on: Mon, 31 October 2016 08:33]

Report message to a moderator

Re: dynamic template proposals in xtext revisited [message #1746496 is a reply to message #1746495] Mon, 31 October 2016 08:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
does it work with

@Override
public Class<? extends ITemplateProposalProvider> bindITemplateProposalProvider() {
return MyDslTemplateProposalProvider.class;
}

??


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: dynamic template proposals in xtext revisited [message #1746497 is a reply to message #1746496] Mon, 31 October 2016 08:36 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
yes, the basic example works like a charm
Previous Topic:JvmTypesBuilder extension injection does not work in static inner classes
Next Topic:Max line length Formatting
Goto Forum:
  


Current Time: Thu Apr 25 04:19:30 GMT 2024

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

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

Back to the top