Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content Assist(complete_XX() methods not getting invoked in the ProposalProvider)
Content Assist [message #1024305] Tue, 26 March 2013 00:40 Go to next message
Neeraj Bhusare is currently offline Neeraj Bhusare
Messages: 93
Registered: July 2009
Location: India
Member
Hi,
I am finding it hard to get the content assist working for the following dsl. To be specific, while defining the type for an attribute (Attribute rule), content assist shows the defined Entities and not the Datatypes (string, decimal,...). For some reason, the methods complete_XXDataType() in the Proposal provider are not getting invoked. If I change the Attribute rule to [0], the complete methods get invoked. Not sure what is going wrong.

I checked the forum but I couldn't find anything related to my problem. I also had a look at couple of dsl's [1], but it didn't help. Any thoughts/pointers ?


NSDeclaration:
// namespace and import
entity=Entity
;

Entity:
'entity' name=ID '{'
attributes+=Attribute*
'}'
;

Attribute:
name=ID ':' type=Type
;

Type:
datatype=DataType | entityRef=EntityReference
;

EntityReference:
entity=[Entity]
;

DataType:
StringDataType | DecimalDataType | BooleanDataType | NumberDataType
;

StringDataType:
'string'
;

DecimalDataType:
'decimal'
;

BooleanDataType:
'boolean'
;

NumberDataType:
'number'
;


------------------------------------------
[0]
Attribute:
name=ID ':' (datatype=DataType | entityRef=EntityReference)
;

-------------------------------------------
[1]
http://www.eclipse.org/Xtext/community.html

Thanks in advance.


Best regards, Neeraj

[Updated on: Tue, 26 March 2013 00:41]

Report message to a moderator

Re: Content Assist [message #1027294 is a reply to message #1024305] Tue, 26 March 2013 16:34 Go to previous messageGo to next message
Ian McDevitt is currently offline Ian McDevitt
Messages: 65
Registered: December 2012
Location: Belfast
Member
For some reason, the methods complete_XXDataType() in the Proposal provider are not getting invoked.

It may be that as your XXDataTypes are Parser rules they are consumed before the later stages of grammar rules, content assist and proposal are run.
As literals I would expect they would get proposed automatically.
Re: Content Assist [message #1027820 is a reply to message #1027294] Wed, 27 March 2013 08:59 Go to previous message
Ian McDevitt is currently offline Ian McDevitt
Messages: 65
Registered: December 2012
Location: Belfast
Member
Actually I meant Data Type Rules (no assignments or actions) rather than Parser rules.

Also you may think you are in the middle of entering a DataType but the parser/proposer may not know if it's that or an EntityReference so may only be able to call complete_Attribute with a reference of 'type'.

I don't know why [0] makes a difference, I'm just suggesting some pointers above, but I have found that simpler grammars work better than many levels of abstraction.
Previous Topic:Unable to launch mwe2 workflow
Next Topic:ecore editor in video
Goto Forum:
  


Current Time: Wed Jul 30 01:05:25 EDT 2014

Powered by FUDForum. Page generated in 0.25494 seconds