Move Statement: Fix comma placement for class parameter
#KT-6672 Fixed
This commit is contained in:
@@ -109,6 +109,7 @@ public class JetDeclarationMover extends AbstractJetUpDownMover {
|
|||||||
if (element == null) return null;
|
if (element == null) return null;
|
||||||
|
|
||||||
JetDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetDeclaration.class, false);
|
JetDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetDeclaration.class, false);
|
||||||
|
if (declaration instanceof JetParameter) return null;
|
||||||
if (declaration instanceof JetTypeParameter) {
|
if (declaration instanceof JetTypeParameter) {
|
||||||
return getMovableDeclaration(declaration.getParent());
|
return getMovableDeclaration(declaration.getParent());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: down
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b:<caret> Int,
|
||||||
|
a: Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: down
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
a: Int,
|
||||||
|
b:<caret> Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: down
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b: Int,
|
||||||
|
<caret>a: Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: down
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b: Int,
|
||||||
|
c: Int,
|
||||||
|
<caret>a: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: up
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
a: Int,
|
||||||
|
b:<caret> Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: up
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b:<caret> Int,
|
||||||
|
a: Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: up
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b: Int,
|
||||||
|
c: Int,
|
||||||
|
<caret>a: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// MOVE: up
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
class A(
|
||||||
|
b: Int,
|
||||||
|
<caret>a: Int,
|
||||||
|
c: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// MOVE: down
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
// IS_APPLICABLE: false
|
||||||
|
class A(
|
||||||
|
b: Int,
|
||||||
|
c: Int,
|
||||||
|
<caret>a: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// MOVE: up
|
||||||
|
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
|
||||||
|
// IS_APPLICABLE: false
|
||||||
|
class A(
|
||||||
|
<caret>b: Int,
|
||||||
|
c: Int,
|
||||||
|
a: Int
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
-72
@@ -476,78 +476,6 @@ public class CodeMoverTestGenerated extends AbstractCodeMoverTest {
|
|||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt");
|
||||||
doTestClassBodyDeclaration(fileName);
|
doTestClassBodyDeclaration(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("valueArgs1.kt")
|
|
||||||
public void testValueArgs1() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueArgs2.kt")
|
|
||||||
public void testValueArgs2() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueArgs3.kt")
|
|
||||||
public void testValueArgs3() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs3.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueArgs4.kt")
|
|
||||||
public void testValueArgs4() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueArgs5.kt")
|
|
||||||
public void testValueArgs5() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueArgs6.kt")
|
|
||||||
public void testValueArgs6() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs6.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams1.kt")
|
|
||||||
public void testValueParams1() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams2.kt")
|
|
||||||
public void testValueParams2() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams3.kt")
|
|
||||||
public void testValueParams3() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams4.kt")
|
|
||||||
public void testValueParams4() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams5.kt")
|
|
||||||
public void testValueParams5() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams5.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("valueParams6.kt")
|
|
||||||
public void testValueParams6() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams6.kt");
|
|
||||||
doTestClassBodyDeclaration(fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property")
|
@TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property")
|
||||||
|
|||||||
Reference in New Issue
Block a user