Move Left/Right: Support type constraints
#KT-26525 Fixed
This commit is contained in:
@@ -28,6 +28,7 @@ class KotlinMoveLeftRightHandler : MoveElementLeftRightHandler() {
|
|||||||
is KtArrayAccessExpression -> return element.indexExpressions.toTypedArray()
|
is KtArrayAccessExpression -> return element.indexExpressions.toTypedArray()
|
||||||
is KtTypeParameterList -> return element.parameters.toTypedArray()
|
is KtTypeParameterList -> return element.parameters.toTypedArray()
|
||||||
is KtSuperTypeList -> return element.entries.toTypedArray()
|
is KtSuperTypeList -> return element.entries.toTypedArray()
|
||||||
|
is KtTypeConstraintList -> return element.constraints.toTypedArray()
|
||||||
//TODO
|
//TODO
|
||||||
// is KtClass -> if (element.isEnum()) return element.declarations.filterIsInstance<KtEnumEntry>().toTypedArray()
|
// is KtClass -> if (element.isEnum()) return element.declarations.filterIsInstance<KtEnumEntry>().toTypedArray()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// MOVE: right
|
||||||
|
interface Foo<E>
|
||||||
|
interface Bar<K, V>
|
||||||
|
interface Baz<E, K, N> where B : <caret>Bar<E, K>, E: Any, F: Foo<E>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// MOVE: right
|
||||||
|
interface Foo<E>
|
||||||
|
interface Bar<K, V>
|
||||||
|
interface Baz<E, K, N> where E: Any, B : <caret>Bar<E, K>, F: Foo<E>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// MOVE: left
|
||||||
|
interface Foo<E>
|
||||||
|
interface Bar<K, V>
|
||||||
|
interface Baz<E, K, N> where B : Bar<E, K>, <caret>E: Any, F: Foo<E>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// MOVE: left
|
||||||
|
interface Foo<E>
|
||||||
|
interface Bar<K, V>
|
||||||
|
interface Baz<E, K, N> where <caret>E: Any, B : Bar<E, K>, F: Foo<E>
|
||||||
Generated
+10
@@ -98,4 +98,14 @@ public class MoveLeftRightTestGenerated extends AbstractMoveLeftRightTest {
|
|||||||
public void testTypeArgs() throws Exception {
|
public void testTypeArgs() throws Exception {
|
||||||
runTest("idea/testData/codeInsight/moveLeftRight/typeArgs.kt");
|
runTest("idea/testData/codeInsight/moveLeftRight/typeArgs.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeConstraints1.kt")
|
||||||
|
public void testTypeConstraints1() throws Exception {
|
||||||
|
runTest("idea/testData/codeInsight/moveLeftRight/typeConstraints1.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeConstraints2.kt")
|
||||||
|
public void testTypeConstraints2() throws Exception {
|
||||||
|
runTest("idea/testData/codeInsight/moveLeftRight/typeConstraints2.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user