Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access to the proposal provider through the Xtext Web application(Xtext Web)
Access to the proposal provider through the Xtext Web application [message #1723577] Tue, 16 February 2016 16:34 Go to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
Hi,

In the standalone version, we can easily have access to the ProposalProvider and, thus, to get access to user defined proposal templates. How this proposal provider can be accessed by a Xtext Web application? Do we need to programmatically define the access to the proposal prodicer already given for the standalone version?

Best Regards

[Updated on: Thu, 20 May 2021 15:06]

Report message to a moderator

Re: Access to the proposal provider through the Xtext Web application [message #1723588 is a reply to message #1723577] Tue, 16 February 2016 16:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14352
Registered: July 2009
Senior Member
hi,

can you be a bit more specific about your question.
the web version has support for proposals by default. (crtl + space)

the proposal provider to implement (subclass) and bind (in the webmodule) is

class MyDslWebModule extends AbstractMyDslWebModule {
	def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
		MyDslProposalProvider
	}
}


class MyDslProposalProvider extends IdeContentProposalProvider {
	
	override createProposals(Collection<ContentAssistContext> contexts, IIdeContentProposalAcceptor acceptor) {
		println("start here")
		super.createProposals(contexts, acceptor)
	}
	
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Access to the proposal provider through the Xtext Web application [message #1723592 is a reply to message #1723588] Tue, 16 February 2016 17:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14352
Registered: July 2009
Senior Member
https://github.com/eclipse/xtext/blob/master/web/org.eclipse.xtext.web.example.statemachine.ide/src/org/eclipse/xtext/web/example/statemachine/ide/StatemachineWebContentProposalProvider.xtend

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Access to the proposal provider through the Xtext Web application [message #1723593 is a reply to message #1723588] Tue, 16 February 2016 17:12 Go to previous messageGo to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
In the ProposalProvider.xtend, i have inserted code for completing my 'code' when the Ctrl+space is pressed.
However, this is not accessed by the Web application as in the standalone.
I inserted the code you mention but my ProposalProvider is not seen by the WebModule
e.g., i get an error when inserting the code in the WebModule.xtend
def Class<? extends IdeContentProposalProvider> bindIdeContentProposalProvider() {
XProposalProvider <--- error: The method or field XProposalProvider is undefined
}
Re: Access to the proposal provider through the Xtext Web application [message #1723594 is a reply to message #1723593] Tue, 16 February 2016 17:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14352
Registered: July 2009
Senior Member
Are you sure you did the class path right. In doubt place the class right
next to the wrbmodule. It might be you need to write a least one char to
get a initial server sync.

Btw what do you mean by standalone


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Access to the proposal provider through the Xtext Web application [message #1723599 is a reply to message #1723594] Tue, 16 February 2016 17:28 Go to previous messageGo to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
I mean that when i run my dsl as an Eclipse plugin, the proposal provider is ok.
In the Web module, the Ctrl+space presents the list of the proposals but when pressing the enter,
the template i inserted in the XProposalProvider.xtend is not placed in the editor.
Btw, in my Eclipse, the XProposalProvider.xtend is in the ui project and not in the ide.
Re: Access to the proposal provider through the Xtext Web application [message #1723601 is a reply to message #1723599] Tue, 16 February 2016 17:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14352
Registered: July 2009
Senior Member
Sry to say but is not the same class

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Access to the proposal provider through the Xtext Web application [message #1723718 is a reply to message #1723601] Wed, 17 February 2016 11:03 Go to previous messageGo to next message
z232 I is currently offline z232 IFriend
Messages: 42
Registered: February 2016
Member
What do you mean?
Re: Access to the proposal provider through the Xtext Web application [message #1723725 is a reply to message #1723718] Wed, 17 February 2016 11:17 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14352
Registered: July 2009
Senior Member
The eclipse proposal provider and the class you have to create (see
previous post) are two completely different classes


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Can't find Miro's blog on Xtext web editor
Next Topic:Running ParsingTest in intellij
Goto Forum:
  


Current Time: Sat Oct 01 15:33:27 GMT 2022

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

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

Back to the top