Hi,
In Xtext/oAW we have used the completion Proposal
provider extensively.
As we have an optional “description”
element in front of each real modelelement we always get a “description”
in the proposal list.\
In oAW/Xtext we used the following
operation to generically filter out the description proposals.
/** Filter out all proiposals that end with Description.
*
This eliminates the descritions from all proposals.
*
Also put a space at the end of all proposals
*/
List[Proposal]
sortProposals(List[Proposal] proposalsToSort):
proposalsToSort.reject(p | p.label.endsWith("Description"));
The sortProposals is implicitly called by
each proposal provider, meaning that we only have to implement this operation once.
It is always automatically caller.
In TMF/xtext a proposal is added to the “acceptor”:
acceptor.accept(completionProposal);
At the end we would like to remove
something from the acceptor, e.g. like this:
acceptor.remove(completionProposal);
This allows us to keep the generated proposals as they are
and only put the “remove” in the overridden operation.
However, The acceptor does not have a “remove”
operation.
I have two questions:
1.
is it
possible to add this “remove” operation to the acceptor?
2.
Is there
something like the sortProposals() which is always called for all proposals
lists in TMF/xText ?
This would allow us to implement this once, instead as for
each rule.
Regards,
Jos Warmer
Partner
Ordina Application Outsourcing en Projecten B.V.
Centre of Excellence