void (@NotNull InsertionContext context) { if (!(myRefPlace instanceof PsiMethodReferenceExpression)) { PsiClass containingClass = Objects.requireNonNull(myMethod.getContainingClass()); String qualifiedName = Objects.requireNonNull(containingClass.getQualifiedName()); final Editor editor = context.getEditor(); final Document document = editor.getDocument(); final int startOffset = context.getStartOffset(); document.insertString(startOffset, qualifiedName + "::"); JavaCompletionUtil.shortenReference(context.getFile(), startOffset + qualifiedName.length() - 1); } }