void (@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); if (element instanceof PyQualifiedExpression) { final PyExpression qualifier = ((PyQualifiedExpression)element).getQualifier(); if (qualifier != null) { final PyType type = TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()).getType(qualifier); if (type instanceof PyClassType) { final PyClass cls = ((PyClassType)type).getPyClass(); final String propertyName = ((PyQualifiedExpression)element).getName(); if (propertyName == null) return; final String fieldName = "_" + propertyName; final PyElementGenerator generator = PyElementGenerator.getInstance(project); final PyFunction property = generator.createProperty(LanguageLevel.forElement(cls), propertyName, fieldName, myAccessDirection); PyPsiRefactoringUtil.addElementToStatementList(property, cls.getStatementList(), myAccessDirection == AccessDirection.READ); } } } }