Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content Assist in Web Editor
Content Assist in Web Editor [message #1748469] Wed, 23 November 2016 12:34 Go to next message
Kostas Kls is currently offline Kostas KlsFriend
Messages: 20
Registered: October 2015
Junior Member
Hi,
I am using the Xtext (Web version) for creating a Web Editor for my language.
When i run my language as an Eclipse plugin, the content assist is ok, however, when i run my Web Editor (not with the use of Eclipse - in the localhost) the custom content assist is not working.
My costumizations concern the class
class EdlProposalProvider extends AbstractEdlProposalProvider (Edl is the name of my language)
that are not presented in the Web version of the editor by pressing Ctrl-Space.
Am i processing the correct file for the content assist of the Web editor?

BR
Re: Content Assist in Web Editor [message #1748479 is a reply to message #1748469] Wed, 23 November 2016 13:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11892
Registered: July 2009
Senior Member
for web you have to customize org.eclipse.xtext.ide.editor.contentassist.IdeContentProposalProvider

make sure you dont stumble over https://github.com/eclipse/xtext-web/issues/5


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: Content Assist in Web Editor [message #1748554 is a reply to message #1748479] Thu, 24 November 2016 10:35 Go to previous messageGo to next message
Kostas Kls is currently offline Kostas KlsFriend
Messages: 20
Registered: October 2015
Junior Member
Thank you for the reply.
Can i find somewhere an example?
Re: Content Assist in Web Editor [message #1748555 is a reply to message #1748554] Thu, 24 November 2016 10:42 Go to previous messageGo to next message
Akos Kitta is currently offline Akos KittaFriend
Messages: 25
Registered: November 2015
Junior Member
There is one for xbase: https://github.com/eclipse/xtext-extras/blob/master/org.eclipse.xtext.xbase.ide/src/org/eclipse/xtext/xbase/ide/contentassist/XbaseIdeContentProposalProvider.xtend
The concept is the same as in the generated Eclipse-based proposal provider but you have to do the case-switching based on your grammar.
Re: Content Assist in Web Editor [message #1748562 is a reply to message #1748555] Thu, 24 November 2016 12:02 Go to previous messageGo to next message
Kostas Kls is currently offline Kostas KlsFriend
Messages: 20
Registered: October 2015
Junior Member
ok, but where should i put the new xtend file?
Re: Content Assist in Web Editor [message #1748563 is a reply to message #1748562] Thu, 24 November 2016 12:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11892
Registered: July 2009
Senior Member
inside the yourdsl.ide project (or the web project)
+ add a binding in the web module


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: Content Assist in Web Editor [message #1748574 is a reply to message #1748563] Thu, 24 November 2016 15:46 Go to previous messageGo to next message
Kostas Kls is currently offline Kostas KlsFriend
Messages: 20
Registered: October 2015
Junior Member
ok, i got it!
Than you for your response!
Re: Content Assist in Web Editor [message #1776707 is a reply to message #1748574] Mon, 20 November 2017 15:32 Go to previous messageGo to next message
Sudhir Agarwal is currently offline Sudhir AgarwalFriend
Messages: 2
Registered: November 2017
Junior Member
I am facing a similar issue. I customized the list of proposals for some grammar elements by overriding corresponding methods in MyDSLProposalProvoder.xtend. This works fine within eclipse plugin.

But I can't get the same functionality to work in the browser. The web server runs without errors. The browser based editor shows proposals that can be derived from the grammar but unlike the plugin editor the browser version doesn't show the customized proposals.

I am a bit new to xtext and I can't quite follow the proposed solution. Is there a bit more step by step guide / code snippets for get this to work?
Re: Content Assist in Web Editor [message #1776733 is a reply to message #1776707] Mon, 20 November 2017 21:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11892
Registered: July 2009
Senior Member
You need to subclass and bind the idecontentproposalprovider in the ide module
Which of this two parts you don't understand

https://github.com/eclipse/xtext-web/blob/master/org.eclipse.xtext.web.example.statemachine.ide/src/org/eclipse/xtext/web/example/statemachine/ide/StatemachineIdeModule.xtend
https://github.com/eclipse/xtext-web/blob/master/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: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: Content Assist in Web Editor [message #1776741 is a reply to message #1776733] Tue, 21 November 2017 03:58 Go to previous message
Sudhir Agarwal is currently offline Sudhir AgarwalFriend
Messages: 2
Registered: November 2017
Junior Member
With the two statemachine links you have provided, it is much easier for me to understand what I need to do than with the xbase link you provided earlier in the discussion.

Now, I am able to produce my custom proposals in the web based version as well.

Thanks much.
Previous Topic:Xtext web editor is disabled
Next Topic:Xtext quick fix provider not run?
Goto Forum:
  


Current Time: Sat Apr 21 06:17:28 GMT 2018

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

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