content assist [message #1770274] |
Wed, 09 August 2017 14:48 |
Susie Agerholm Messages: 54 Registered: April 2017 |
Member |
|
|
I have a grammar element, that look like this:
Joint:
'Joint' name=ID
(('def' 'ChildOf' childOf=[Link]
'ParentOf' parentOf=[Link]
'Type' type=JointType)
( origin=Origin | axis=Axis | limit=Limit | calibration=Calibration | dynamics=Dynamics | safetycontroller=SafetyController)* |
('reuse' isReuseOf=[Joint]
'ChildOf' childOf=[Link]
'ParentOf' parentOf=[Link]
(reuse=Reuse)?
)
)
;
origin, axis, limit, calibration, dynamics and safetycontroller are all optional, but if they are defined, they should not be repeated for a joint. I guess I need to define these optionals like an alternative in the grammar, so the user can define the optionals out of order and still get all available options suggested.
I don't want the content assist to keep suggesting keyword in the case, that particular assignment has already been made - e.g. if the joint already have an origin assigned, origin should not appear in content asssist suggestion box while defining the joint.
I have tried to make a custom proposal provider to override this method in the AbstractPropoposal provider. The method adds my proposal to the content assist, but it does not override the original suggestion - the Origin keyword still appears in the content assist?
override completeJoint_Origin(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
val proposal="test adding stuff";
val completionProposal = createCompletionProposal(proposal, context);
acceptor.accept(completionProposal);
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds