mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-509
Extract Method wants to pass a class as a method parameter
This commit is contained in:
@@ -74,9 +74,12 @@ public class PyCodeFragmentBuilder extends PyRecursiveElementVisitor {
|
||||
if (position == Position.INSIDE) {
|
||||
for (ResolveResult result : element.multiResolve(false)) {
|
||||
final PsiElement declaration = result.getElement();
|
||||
if (declaration == null || !PsiTreeUtil.isAncestor(myOwner, declaration, false)){
|
||||
// Ignore outer elements or import statements
|
||||
if (declaration == null || !PsiTreeUtil.isAncestor(myOwner, declaration, false) ||
|
||||
declaration instanceof PyImportElement){
|
||||
continue;
|
||||
}
|
||||
|
||||
final Position pos = CodeFragmentUtil.getPosition(declaration, startOffset, endOffset);
|
||||
// If declaration is before add it to input
|
||||
if (pos == Position.BEFORE) {
|
||||
|
||||
Reference in New Issue
Block a user