Extract method - disable ability to extract "from" statement
This commit is contained in:
Oleg Shpynov
2010-02-12 18:41:15 +03:00
parent 345be73093
commit 2e3a359292
@@ -65,6 +65,10 @@ public class PyRefactoringUtil {
if (!(parent instanceof PyExpression)){
return null;
}
// We cannot extract anything within import statements
if (PsiTreeUtil.getParentOfType(parent, PyImportStatement.class, PyFromImportStatement.class) != null){
return null;
}
if ((element1 == PsiTreeUtil.getDeepestFirst(parent)) && (element2 == PsiTreeUtil.getDeepestLast(parent))) {
return parent;
}