PSI: Do not delete package directive for file in default package

#KT-24968 Fixed
This commit is contained in:
Alexey Sedunov
2018-06-19 17:18:45 +03:00
parent e2a632e326
commit 60583e557f
6 changed files with 32 additions and 1 deletions
@@ -119,7 +119,10 @@ public class KtPackageDirective extends KtModifierListOwnerStub<KotlinPlaceHolde
public void setFqName(@NotNull FqName fqName) {
if (fqName.isRoot()) {
delete();
if (!getFqName().isRoot()) {
//noinspection ConstantConditions
replace(new KtPsiFactory(getProject()).createFile("").getPackageDirective());
}
return;
}