cp.setTriggerCharacters(new char[] { ' ' });
if (p.getType() == Type.Property) {
// add ": " to proposal
cp.setTextApplier(new IReplacementTextApplier() {
@Override
public void apply(IDocument document, ConfigurableCompletionProposal proposal) throws BadLocationException {
document.replace(proposal.getReplacementOffset(), proposal.getReplacementLength(), proposal.getReplacementString() + ": ");
proposal.setCursorPosition(proposal.getCursorPosition()+2);
}
});
}
if (p.getType() == Type.Value) {
cp.setTextApplier(new IReplacementTextApplier() {
private int findWSCountBeforeProposal(IDocument document, ConfigurableCompletionProposal proposal) throws BadLocationException {
// remove spaces " " before proposal
int offset = 0;