Tests for showing synthetic methods in file structure view
This commit is contained in:
+2
-1
@@ -151,7 +151,8 @@ class KotlinStructureElementPresentation implements ColoredItemPresentation, Loc
|
|||||||
return withRightArrow(ONLY_NAMES_WITH_SHORT_TYPES.render(firstOverriding.getContainingDeclaration()));
|
return withRightArrow(ONLY_NAMES_WITH_SHORT_TYPES.render(firstOverriding.getContainingDeclaration()));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalStateException("At least one element should be returned");
|
// Location can be missing when base in synthesized
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String withRightArrow(String str) {
|
private static String withRightArrow(String str) {
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
public class TestSAM {
|
||||||
|
public interface SamClass {
|
||||||
|
void foo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void foo(SamClass samClass) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
-InheritedSAMConversion.kt
|
||||||
|
-KotlinTest
|
||||||
|
clone(): Any location=→Object
|
||||||
|
equals(Any?): Boolean location=→Object
|
||||||
|
finalize(): Unit location=→Object
|
||||||
|
foo((() -> Unit)?): Unit
|
||||||
|
getClass(): Class<out Any?> location=→Object
|
||||||
|
hashCode(): Int location=→Object
|
||||||
|
notify(): Unit location=→Object
|
||||||
|
notifyAll(): Unit location=→Object
|
||||||
|
toString(): String location=→Object
|
||||||
|
wait(): Unit location=→Object
|
||||||
|
wait(Long): Unit location=→Object
|
||||||
|
wait(Long, Int): Unit location=→Object
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
class KotlinTest : TestSAM
|
||||||
|
|
||||||
|
// TODO: Show both methods - synthetic and original (base mehtod without Kotlin signature)
|
||||||
|
// TODO: Show location for synthetic method
|
||||||
|
|
||||||
|
// WITH_INHERITED
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-InheritedSynthesizedFromDataClass.kt
|
||||||
|
-Derived
|
||||||
|
a: Int location=→TestData
|
||||||
|
equals(Any?): Boolean location=→Any
|
||||||
|
field: Int
|
||||||
|
hashCode(): Int location=→Any
|
||||||
|
some(): Unit location=→TestData
|
||||||
|
toString(): String location=→Any
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
data open class TestData(val a: Int) {
|
||||||
|
fun some() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Derived: TestData(1) {
|
||||||
|
val field = component1()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: show component1, component2 functions?
|
||||||
|
// TODO: should equals and hashCode be shown as declared in TestData?
|
||||||
|
|
||||||
|
// WITH_INHERITED
|
||||||
+10
@@ -86,6 +86,16 @@ public class KotlinFileStructureTestGenerated extends AbstractKotlinFileStructur
|
|||||||
doTest("idea/testData/structureView/fileStructure/InheritedMembersWithSubstitutedTypes.kt");
|
doTest("idea/testData/structureView/fileStructure/InheritedMembersWithSubstitutedTypes.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("InheritedSAMConversion.kt")
|
||||||
|
public void testInheritedSAMConversion() throws Exception {
|
||||||
|
doTest("idea/testData/structureView/fileStructure/InheritedSAMConversion.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("InheritedSynthesizedFromDataClass.kt")
|
||||||
|
public void testInheritedSynthesizedFromDataClass() throws Exception {
|
||||||
|
doTest("idea/testData/structureView/fileStructure/InheritedSynthesizedFromDataClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("Render.kt")
|
@TestMetadata("Render.kt")
|
||||||
public void testRender() throws Exception {
|
public void testRender() throws Exception {
|
||||||
doTest("idea/testData/structureView/fileStructure/Render.kt");
|
doTest("idea/testData/structureView/fileStructure/Render.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user