use of com.jetbrains.python.psi.PyForPart in project intellij-community by JetBrains.
the class PyForStatementNavigator method getPyForStatementByBody.
@Nullable
public static Object getPyForStatementByBody(final PsiElement element) {
final PyForStatement forStatement = PsiTreeUtil.getParentOfType(element, PyForStatement.class, false);
if (forStatement == null) {
return null;
}
final PyForPart forPart = forStatement.getForPart();
return forPart == element || forPart.getStatementList() == element ? forStatement : null;
}
Aggregations