LookupElement (final String className, LookupElement item) { return PrioritizedLookupElement.withExplicitProximity(new LookupElementDecorator<>(item) { @Override public void renderElement(@NotNull LookupElementPresentation presentation) { super.renderElement(presentation); presentation.setItemText(className + ".super." + presentation.getItemText()); } @Override public void handleInsert(@NotNull InsertionContext context) { context.commitDocument(); PsiJavaCodeReferenceElement ref = PsiTreeUtil .findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiJavaCodeReferenceElement.class, false); if (ref != null) { context.getDocument().insertString(ref.getTextRange().getStartOffset(), className + "."); } super.handleInsert(context); } }, -1); }