Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content assist not working...(Not sure if this is a bug or by design?)
Content assist not working... [message #1059125] Thu, 16 May 2013 20:53 Go to next message
Josh Gentry is currently offline Josh GentryFriend
Messages: 4
Registered: May 2013
Junior Member
Test:
	name=ID
	'values'
	one?=ValueOne?
	two?=ValueTwo?
;

ValueOne:
	'aaa' 'bbb'
;
ValueTwo:
	'ccc' 'ddd'
;


With the above definition, if I hit crtl-space after providing an ID, it correctly presents "values", however hitting crtl-space after "values" I get nothing, if I enter "aaa" and hit crtl-space, I also get nothing.

The complete_ValueOne() and complete_ValueTwo() methods from MyDslProposalProvider are called when hitting ctrl-space before typing "aaa", or before completing the "aaa" keyword. So I can provide content assist at those points. But once I'm inside ValueOne or ValueTwo I can't seem to provide content assistance. Even implementing the completeKeyword() method doesn't help as it's not called when I'm inside the ValueOne or valueTwo elements.

Is this a bug? Is this what is expected to happen? Is there some way I CAN provide content assist at that point?

I know I can rewrite it to something like:

Test:
	name=ID
	'values'
	(one?='aaa' 'bbb')?
	(two?='ccc' 'ddd')?
;


My goal is to reuse the ValueOne/ValueTwo elements elsewhere for consistency. Also the first example feels cleaner to me.

This is happening with the latest publicly released version of xtext (I did an update today to see if that fixed the problem.)
Re: Content assist not working... [message #1059227 is a reply to message #1059125] Fri, 17 May 2013 12:06 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

there is no out of the box content assist for datatype rules (even if they have only one or few possible values).

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Content assist not working... [message #1059239 is a reply to message #1059227] Fri, 17 May 2013 12:54 Go to previous messageGo to next message
Josh Gentry is currently offline Josh GentryFriend
Messages: 4
Registered: May 2013
Junior Member
Thank you for the response. Your response plus a new day and all that, prompted me to try:

Test:
	name=ID
	'values'
	one?=ValueOne?
	two?=ValueTwo?
;

ValueOne:
	{ValueOne}
	'aaa' 'bbb'
;
ValueTwo:
	{ValueTwo}
	'ccc' 'ddd'
;


Which appears to force content assist to work inside the ValueOne and ValueTwo elements.
Re: Content assist not working... [message #1059327 is a reply to message #1059239] Fri, 17 May 2013 14:12 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

using the action you make ValueOne etc. an object rather than a data type. This is why now you get content assist for the keywords within the rule instantiating the objects.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:JvmTypesBuilder#inferredType Failure
Next Topic:Maven-Tycho + Xtend Sample
Goto Forum:
  


Current Time: Thu Apr 25 02:21:00 GMT 2024

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

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

Back to the top