String (@NotNull PsiElement element) { if (element instanceof PsiReferenceExpression && ((PsiReferenceExpression)element).getQualifierExpression() != null) { final PsiElement resolve = ((PsiReferenceExpression)element).resolve(); if (resolve instanceof PsiClass) return element.getText(); final PsiElement referencedElement = ((PsiReferenceExpression)element).getReferenceNameElement(); final String text = referencedElement != null ? referencedElement.getText() : ""; if (resolve == null && !text.isEmpty() && Character.isUpperCase(text.charAt(0))) { return element.getText(); } return text; } return super.getMeaningfulText(element); }