Light Classes: Implement light elements for 'extends'/'implements' reference lists. Support adding/removing of super type list entries via light elements.

Fix exception on applying "Convert to class" intention to Java interface with Kotlin inheritor(s)
 #KT-11281 Fixed
(cherry picked from commit 4ec4914)
This commit is contained in:
Alexey Sedunov
2016-06-20 17:54:03 +03:00
parent 8e061c9ec1
commit 248f4c1645
10 changed files with 156 additions and 2 deletions
@@ -0,0 +1,9 @@
interface IK
class C2 : I() {
}
class C3: I(), IK {
}
@@ -0,0 +1,4 @@
// "Convert to 'class'" "true"
public abstract class <caret>I {
}
@@ -0,0 +1,9 @@
interface IK
class C2 : I {
}
class C3: I, IK {
}
@@ -0,0 +1,4 @@
// "Convert to 'class'" "true"
public interface <caret>I {
}
@@ -544,6 +544,21 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
}
@TestMetadata("idea/testData/quickfix/convertJavaInterfaceToClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConvertJavaInterfaceToClass extends AbstractQuickFixMultiFileTest {
public void testAllFilesPresentInConvertJavaInterfaceToClass() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/convertJavaInterfaceToClass"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), true);
}
@TestMetadata("kotlinInheritor.before.Main.java")
public void testKotlinInheritor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/quickfix/convertJavaInterfaceToClass/kotlinInheritor.before.Main.java");
doTestWithExtraFile(fileName);
}
}
@TestMetadata("idea/testData/quickfix/createFromUsage")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)