Filter the terminals list proposed in content assistant [message #1831232] |
Fri, 14 August 2020 13:06 |
Georgiana Ecobici Messages: 23 Registered: July 2019 |
Junior Member |
|
|
When a grammar is more permisive, it is possible to filter the terminals proposed in content assistant?
In the grammar below, need to show in Content Assist only Component or only Function depending on my context.
Model:
'scenario' begin = '{' participants+=Participant*
end = '}';
Participant:
Component | Function
;
Component:
'component' name=STRING (nature = ('unset' | 'behavior' | 'node'))?
;
Function:
'function' name=STRING 'as' id=ID
;
Tried to override the complete_ methods in AbstractDslProposalProvider (Dsl-the name of the grammar file), but it still proposes all the terminals (keywords supported).
override void completeModel_Participants(EObject model, Assignment assignment, ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("test1", "test1", null, context));
}
override complete_Participant(EObject model, RuleCall ruleCall, ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("test2", "test2", null, context));
}
override void complete_Component(EObject model, RuleCall ruleCall, ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
// subclasses may override
acceptor.accept(createCompletionProposal("test3", "test3", null, context));
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03639 seconds