ECore Double attribute does not show its name in content assist editor [message #913088] |
Fri, 14 September 2012 18:54 |
|
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 #915587 is a reply to message #913142] |
Mon, 17 September 2012 15:36 |
|
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));
}
|
|
|
Powered by
FUDForum. Page generated in 0.04870 seconds