CreateExpectActualFix: fix package for files with root package from non-root directory
#KT-28746 Fixed
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ abstract class AbstractCreateDeclarationFix<D : KtNamedDeclaration>(
|
||||
val packageDirective = originalFile.packageDirective
|
||||
if (packageDirective != null) {
|
||||
val oldPackageDirective = targetFile.packageDirective
|
||||
val newPackageDirective = factory.createPackageDirective(packageDirective.fqName)
|
||||
val newPackageDirective = packageDirective.copy() as KtPackageDirective
|
||||
if (oldPackageDirective != null) {
|
||||
oldPackageDirective.replace(newPackageDirective)
|
||||
} else {
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Create actual class for module testModule_JVM (JVM)" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
expect class <caret>My
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Create actual class for module testModule_JVM (JVM)" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
expect class My
|
||||
+1
@@ -0,0 +1 @@
|
||||
actual class My
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect class `My.kt.after`
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Create expected class in common module testModule_Common" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual class <caret>My
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Create expected class in common module testModule_Common" "true"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual class My
|
||||
+10
@@ -204,6 +204,11 @@ public class QuickFixMultiModuleTestGenerated extends AbstractQuickFixMultiModul
|
||||
runTest("idea/testData/multiModuleQuickFix/convertPropertyToFunction/");
|
||||
}
|
||||
|
||||
@TestMetadata("createActualWithRootPackage")
|
||||
public void testCreateActualWithRootPackage() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/createActualWithRootPackage/");
|
||||
}
|
||||
|
||||
@TestMetadata("createClassFromUsageImport")
|
||||
public void testCreateClassFromUsageImport() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/createClassFromUsageImport/");
|
||||
@@ -214,6 +219,11 @@ public class QuickFixMultiModuleTestGenerated extends AbstractQuickFixMultiModul
|
||||
runTest("idea/testData/multiModuleQuickFix/createClassFromUsageRef/");
|
||||
}
|
||||
|
||||
@TestMetadata("createExpectWithRootPackage")
|
||||
public void testCreateExpectWithRootPackage() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/createExpectWithRootPackage/");
|
||||
}
|
||||
|
||||
@TestMetadata("createFunInExpectClass")
|
||||
public void testCreateFunInExpectClass() throws Exception {
|
||||
runTest("idea/testData/multiModuleQuickFix/createFunInExpectClass/");
|
||||
|
||||
Reference in New Issue
Block a user