Move: Fix exception on moving Kotlin file without declarations
#KT-14114 Fixed
This commit is contained in:
+2
@@ -130,6 +130,8 @@ class MoveKotlinDeclarationsProcessor(
|
||||
fun getConflictsAsUsages(): List<UsageInfo> = conflicts.entrySet().map { ConflictUsageInfo(it.key, it.value) }
|
||||
|
||||
public override fun findUsages(): Array<UsageInfo> {
|
||||
if (elementsToMove.isEmpty()) return UsageInfo.EMPTY_ARRAY
|
||||
|
||||
val newContainerName = descriptor.moveTarget.targetContainerFqName?.asString() ?: ""
|
||||
|
||||
fun collectUsages(kotlinToLightElements: Map<KtNamedDeclaration, List<PsiNamedElement>>, result: MutableList<UsageInfo>) {
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
package q
|
||||
Vendored
Vendored
+1
@@ -0,0 +1 @@
|
||||
package p
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "p/test.kt",
|
||||
"type": "MOVE_FILES",
|
||||
"targetPackage": "q"
|
||||
}
|
||||
@@ -257,6 +257,12 @@ public class MoveTestGenerated extends AbstractMoveTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kotlin/moveFile/moveFileWithoutDeclarations/moveFileWithoutDeclarations.test")
|
||||
public void testKotlin_moveFile_moveFileWithoutDeclarations_MoveFileWithoutDeclarations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/move/kotlin/moveFile/moveFileWithoutDeclarations/moveFileWithoutDeclarations.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kotlin/moveFile/moveFileWithoutPackageRename/moveFileWithoutPackageRename.test")
|
||||
public void testKotlin_moveFile_moveFileWithoutPackageRename_MoveFileWithoutPackageRename() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/move/kotlin/moveFile/moveFileWithoutPackageRename/moveFileWithoutPackageRename.test");
|
||||
|
||||
Reference in New Issue
Block a user