List<PyTargetExpression> () { PyClassStub stub = getStub(); if (stub != null) { final PyTargetExpression[] children = stub.getChildrenByType(PyElementTypes.TARGET_EXPRESSION, PyTargetExpression.EMPTY_ARRAY); return Arrays.asList(children); } List<PyTargetExpression> result = new ArrayList<>(); for (PsiElement psiElement : getStatementList().getChildren()) { if (psiElement instanceof PyAssignmentStatement assignmentStatement) { final PyExpression[] targets = assignmentStatement.getTargets(); for (PyExpression target : targets) { if (target instanceof PyTargetExpression) { result.add((PyTargetExpression)target); } } } else if (psiElement instanceof PyTypeDeclarationStatement) { final PyExpression target = ((PyTypeDeclarationStatement)psiElement).getTarget(); if (target instanceof PyTargetExpression) { result.add((PyTargetExpression)target); } } } return result; }