use of com.intellij.codeInsight.template.TemplateLookupSelectionHandler in project intellij-community by JetBrains.
the class TemplateExpressionLookupElement method doHandleInsert.
private void doHandleInsert(InsertionContext context) {
LookupElement item = getDelegate();
PsiDocumentManager.getInstance(context.getProject()).commitAllDocuments();
TextRange range = myState.getCurrentVariableRange();
final TemplateLookupSelectionHandler handler = item.getUserData(TemplateLookupSelectionHandler.KEY_IN_LOOKUP_ITEM);
if (handler != null && range != null) {
handler.itemSelected(item, context.getFile(), context.getDocument(), range.getStartOffset(), range.getEndOffset());
} else {
super.handleInsert(context);
}
}
Aggregations