Skip to main content


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 04:40 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior 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.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj

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

Report message to a moderator

Re: Content Assist [message #1027294 is a reply to message #1024305] Tue, 26 March 2013 20:34 Go to previous messageGo to next message
Ian McDevitt is currently offline Ian McDevittFriend
Messages: 70
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 12:59 Go to previous message
Ian McDevitt is currently offline Ian McDevittFriend
Messages: 70
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:Exception: org.eclipse.xtext.junit.serializer.SerializerTester.serialize(SerializerTester.java:234)
Next Topic:ecore editor in video
Goto Forum:
  


Current Time: Fri Apr 26 19:33:45 GMT 2024

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

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

Back to the top