ItemToReplaceDescriptor (@NotNull PsiThisExpression thisExpression) { PsiType expressionType = thisExpression.getType(); if (expressionType != null) { PsiClass psiClass = PsiTypesUtil.getPsiClass(expressionType); if (psiClass != null) { return new ThisReferenceDescriptor(thisExpression, psiClass); } } return null; }