fix JetPsiUtil.deleteClass() so that it no longer tries to delete the entire file when deleting a nested class or object

#KT-7483 Fixed
This commit is contained in:
Dmitry Jemerov
2015-04-27 18:37:43 +02:00
parent cb553bc952
commit c2944181be
4 changed files with 17 additions and 2 deletions
@@ -0,0 +1,6 @@
class A {
fun foo(): Int = 0
companion ob<caret>ject {}
}
@@ -0,0 +1,4 @@
class A {
fun foo(): Int = 0
}
@@ -133,6 +133,12 @@ public class JetSafeDeleteTestGenerated extends AbstractJetSafeDeleteTest {
doObjectTest(fileName);
}
@TestMetadata("companionObject.kt")
public void testCompanionObject() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/safeDelete/deleteObject/kotlinObject/companionObject.kt");
doObjectTest(fileName);
}
@TestMetadata("localObject1.kt")
public void testLocalObject1() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/safeDelete/deleteObject/kotlinObject/localObject1.kt");