Skip to main content



      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 11:34 Go to next message
Eclipse UserFriend
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 11:06] by Moderator

Re: Access to the proposal provider through the Xtext Web application [message #1723588 is a reply to message #1723577] Tue, 16 February 2016 11:55 Go to previous messageGo to next message
Eclipse UserFriend
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)
	}
	
}
Re: Access to the proposal provider through the Xtext Web application [message #1723592 is a reply to message #1723588] Tue, 16 February 2016 12:07 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Access to the proposal provider through the Xtext Web application [message #1723593 is a reply to message #1723588] Tue, 16 February 2016 12:12 Go to previous messageGo to next message
Eclipse UserFriend
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 12:17 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Access to the proposal provider through the Xtext Web application [message #1723599 is a reply to message #1723594] Tue, 16 February 2016 12:28 Go to previous messageGo to next message
Eclipse UserFriend
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 12:35 Go to previous messageGo to next message
Eclipse UserFriend
Sry to say but is not the same class
Re: Access to the proposal provider through the Xtext Web application [message #1723718 is a reply to message #1723601] Wed, 17 February 2016 06:03 Go to previous messageGo to next message
Eclipse UserFriend
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 06:17 Go to previous message
Eclipse UserFriend
The eclipse proposal provider and the class you have to create (see
previous post) are two completely different classes
Previous Topic:Can't find Miro's blog on Xtext web editor
Next Topic:Running ParsingTest in intellij
Goto Forum:
  


Current Time: Mon Jul 14 20:01:23 EDT 2025

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

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

Back to the top