Another Content Assist doubt [message #851071] |
Fri, 20 April 2012 12:11  |
Eclipse User |
|
|
|
Hi,
I've created a dsl project based on existent ecore model.
xtext have created this:
UnitType returns UnitType:
{UnitType}
'UnitType:'
name=EString
;
EString returns ecore::EString:
STRING | ID;
OrganizationUnit returns OrganizationUnit:
{OrganizationUnit}
'OrganizationUnit:'
name=EString
'{'
('unitType:' unitType=[UnitType|EString])?
'}';
When I create a OrganizationUnit in a running the eclipse runtime, if I type ctrl-space after OrganizationUnit:, the content assist don't show the option "Name"... but appears OrganizationUnit: again...
Well, if I change the type of feature name to the terminal STRING or ID, content assist starts to show the name option properly...
Please, could someone explain me this behavior ?
regards,
Cristiano
|
|
|
|
|
|
|
Re: Another Content Assist doubt [message #851244 is a reply to message #851214] |
Fri, 20 April 2012 15:57   |
Eclipse User |
|
|
|
public class MyDslProposalProvider extends AbstractMyDslProposalProvider {
@Override
public void completeUnitType_Name(EObject model, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("YouAreTheGuiWhoKnowsWhatAUnitTypeNameIs", context));
super.completeUnitType_Name(model, assignment, context, acceptor);
}
@Override
public void complete_EString(EObject model, RuleCall ruleCall,
ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("ThisIsAnEString", context));
acceptor.accept(createCompletionProposal("\"ThisIsAnEStringToo\"", context));
super.complete_EString(model, ruleCall, context, acceptor);
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.08148 seconds