LookupElement (@NotNull PsiExpression expression, @Nullable Icon icon, @NotNull String presentableText, @NotNull String lookupText) { final LookupElement element = new ExpressionLookupItem(expression, icon, presentableText, lookupText) { @Override public void handleInsert(@NotNull InsertionContext context) { context.getDocument().deleteString(context.getStartOffset(), context.getTailOffset()); context.commitDocument(); replaceText(context, getObject().getText()); } }; return PrioritizedLookupElement.withPriority(element, 1); }