Skip to main content



      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 16:53 Go to next message
Eclipse UserFriend
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 08:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

Alex
Re: Content assist not working... [message #1059239 is a reply to message #1059227] Fri, 17 May 2013 08:54 Go to previous messageGo to next message
Eclipse UserFriend
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 10:12 Go to previous message
Eclipse UserFriend
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
Previous Topic:JvmTypesBuilder#inferredType Failure
Next Topic:Maven-Tycho + Xtend Sample
Goto Forum:
  


Current Time: Sun Jul 06 12:19:11 EDT 2025

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

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

Back to the top