Retain empty companion in KtNamedDeclarationStub.remove
This commit is contained in:
@@ -157,17 +157,4 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
|
|||||||
}
|
}
|
||||||
return KtNamedDeclarationUtil.getFQName(this);
|
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