Pull Up/Extract Super: Support members declared in the companion object of the original class
This commit is contained in:
@@ -139,4 +139,17 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
|
||||
}
|
||||
return KtNamedDeclarationUtil.getFQName(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() throws IncorrectOperationException {
|
||||
KtClassOrObject classOrObject = KtPsiUtilKt.getContainingClassOrObject(this);
|
||||
|
||||
super.delete();
|
||||
|
||||
if (classOrObject instanceof KtObjectDeclaration
|
||||
&& ((KtObjectDeclaration) classOrObject).isCompanion()
|
||||
&& classOrObject.getDeclarations().isEmpty()) {
|
||||
classOrObject.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user