public boolean validate(IDocument document, int offset, DocumentEvent event) {
		try {
			String content= document.get(replacementPosition.getOffset(), offset - replacementPosition.getOffset());
			if (replacementString.startsWith(content))
				return true;
		} catch (BadLocationException e) {
			// ignore concurrently modified document
		}
		return false;
	}
The additional info of this proposal
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/templates/SQLVariableCompletionProposal.java