Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ECore Double attribute does not show its name in content assist editor(Control-Space is not showing the name of my attributes of type ecore double)
ECore Double attribute does not show its name in content assist editor [message #913088] Fri, 14 September 2012 18:54 Go to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member


Hi,
I am trying to figure out how to get my xtext generated editor to show the variable/attribute name when pressing control-space, it works fine with INT, STRING, ID etc. but not with the ECore Double I have defined as the following in my grammer:
Anyone have any ideas how to get the contet assist to work correctly with this variable named 'balance' - Duncan

Account:
'Account' name=ID balance=DOUBLE;


terminal DOUBLE returns ecore::EDouble : '-'? ('0'..'9')+ '.' ('0'..'9')+ (('e'|'E') ('-')? ('0'..'9')+)?;
Re: ECore Double attribute does not show its name in content assist editor [message #913098 is a reply to message #913088] Fri, 14 September 2012 19:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

for custom things you have to define the content assist yourself.
Xtext does NOT reverseengineer terminal rules Wink

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: ECore Double attribute does not show its name in content assist editor [message #913136 is a reply to message #913098] Fri, 14 September 2012 20:58 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

Thanks,
Do you know what class I might want to look at to extend? - Duncan
Re: ECore Double attribute does not show its name in content assist editor [message #913142 is a reply to message #913136] Fri, 14 September 2012 21:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
On 2012-09-14 20:58:38 +0000, Duncan Krebs said:

> Thanks, Do you know what class I might want to look at to extend? - Duncan

XXXProposalProvider - the class is already there
--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: ECore Double attribute does not show its name in content assist editor [message #915587 is a reply to message #913142] Mon, 17 September 2012 15:36 Go to previous message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

Christian,
I tried figuring it out over the weekend the best I was able to get working was on control space for my DOUBLE attribute it hard coded the value instead of displaying the name of the attribute (maxLoss) like it normally does for other "built in" types like INT, ID and string, this is the code I added to my xxxProposalAdvisor


public void completeSurfStrategyType1_MaxLoss(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		super.completeSurfStrategyType1_MaxLoss(model, assignment, context, acceptor);
		String proposal = "MaxLoss" + "DOUBLE";
		acceptor.accept(createCompletionProposal(proposal, context));
	}
Previous Topic:hidden whitespaces and formatting
Next Topic:Custom Content Assist
Goto Forum:
  


Current Time: Thu Apr 25 08:47:35 GMT 2024

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

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

Back to the top