PsiElement (PsiElement element, Project project, Editor editor) { final PyAssignmentStatement assignmentStatement = PsiTreeUtil.getParentOfType(element, PyAssignmentStatement.class); if (assignmentStatement != null) { return assignmentStatement.getTargets()[0]; } else if (element instanceof PyNamedParameter) { return element; } return null; }