mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-474
Extract method - disable ability to extract "from" statement
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user