void (@NotNull final PsiClass targetClass, @NotNull final GrReferenceElement ref) { ApplicationManager.getApplication().runWriteAction(() -> { final PsiElement newRef = ref.bindToElement(targetClass); JavaCodeStyleManager.getInstance(targetClass.getProject()).shortenClassReferences(newRef); }); }