From fe8891299b6b2c09c2e7169e281136077b00ee0f Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 29 May 2013 13:11:46 +0400 Subject: [PATCH] Implement "move class-level declaration up/down" action handler --- .../jet/lang/psi/JetClassInitializer.java | 10 + .../jet/lang/psi/JetClassObject.java | 7 + .../jet/generators/tests/GenerateTests.java | 8 + idea/src/META-INF/plugin.xml | 4 + .../upDownMover/AbstractJetUpDownMover.java | 63 +++ .../upDownMover/JetDeclarationMover.java | 263 ++++++++++ .../accessors/accessor1.kt | 6 + .../accessors/accessor2.kt | 6 + .../accessors/accessor3.kt | 8 + .../accessors/accessor3.kt.after | 8 + .../accessors/accessor4.kt | 8 + .../accessors/accessor4.kt.after | 8 + .../class/classAtBrace1.kt | 8 + .../class/classAtBrace1.kt.after | 8 + .../class/classAtBrace2.kt | 8 + .../class/classAtBrace2.kt.after | 8 + .../class/classAtBrace3.kt | 8 + .../class/classAtBrace3.kt.after | 8 + .../class/classAtBrace4.kt | 8 + .../class/classAtBrace4.kt.after | 8 + .../class/classAtBrace5.kt | 9 + .../class/classAtBrace6.kt | 9 + .../class/classAtClass1.kt | 9 + .../class/classAtClass1.kt.after | 9 + .../class/classAtClass2.kt | 9 + .../class/classAtClass2.kt.after | 9 + .../class/classAtClassInitializer1.kt | 9 + .../class/classAtClassInitializer1.kt.after | 9 + .../class/classAtClassInitializer2.kt | 9 + .../class/classAtClassInitializer2.kt.after | 9 + .../class/classAtEmptyLine1.kt | 8 + .../class/classAtEmptyLine1.kt.after | 8 + .../class/classAtEmptyLine2.kt | 8 + .../class/classAtEmptyLine2.kt.after | 8 + .../class/classAtFunction1.kt | 9 + .../class/classAtFunction1.kt.after | 9 + .../class/classAtFunction2.kt | 9 + .../class/classAtFunction2.kt.after | 9 + .../class/classAtProperty1.kt | 7 + .../class/classAtProperty1.kt.after | 7 + .../class/classAtProperty2.kt | 7 + .../class/classAtProperty2.kt.after | 7 + .../classInitializerAtBrace1.kt | 7 + .../classInitializerAtBrace2.kt | 7 + .../classInitializerAtClass1.kt | 9 + .../classInitializerAtClass1.kt.after | 9 + .../classInitializerAtClass2.kt | 9 + .../classInitializerAtClass2.kt.after | 9 + .../classInitializerAtClassInitializer1.kt | 9 + ...assInitializerAtClassInitializer1.kt.after | 9 + .../classInitializerAtClassInitializer2.kt | 9 + ...assInitializerAtClassInitializer2.kt.after | 9 + .../classInitializerAtEmptyLine1.kt | 8 + .../classInitializerAtEmptyLine1.kt.after | 8 + .../classInitializerAtEmptyLine2.kt | 8 + .../classInitializerAtEmptyLine2.kt.after | 8 + .../classInitializerAtFunction1.kt | 9 + .../classInitializerAtFunction1.kt.after | 9 + .../classInitializerAtFunction2.kt | 9 + .../classInitializerAtFunction2.kt.after | 9 + .../classInitializerAtProperty1.kt | 7 + .../classInitializerAtProperty1.kt.after | 7 + .../classInitializerAtProperty2.kt | 7 + .../classInitializerAtProperty2.kt.after | 7 + .../classBodyDeclarations/enums/enum1.kt | 7 + .../enums/enum1.kt.after | 7 + .../classBodyDeclarations/enums/enum2.kt | 8 + .../classBodyDeclarations/enums/enum3.kt | 8 + .../classBodyDeclarations/enums/enum4.kt | 7 + .../enums/enum4.kt.after | 7 + .../classBodyDeclarations/enums/enum5.kt | 10 + .../enums/enum5.kt.after | 10 + .../classBodyDeclarations/enums/enum6.kt | 10 + .../enums/enum6.kt.after | 10 + .../function/functionAtBrace1.kt | 8 + .../function/functionAtBrace1.kt.after | 8 + .../function/functionAtBrace2.kt | 8 + .../function/functionAtBrace2.kt.after | 8 + .../function/functionAtBrace3.kt | 8 + .../function/functionAtBrace3.kt.after | 8 + .../function/functionAtBrace4.kt | 8 + .../function/functionAtBrace4.kt.after | 8 + .../function/functionAtBrace5.kt | 9 + .../function/functionAtBrace6.kt | 9 + .../function/functionAtClass1.kt | 9 + .../function/functionAtClass1.kt.after | 9 + .../function/functionAtClass2.kt | 9 + .../function/functionAtClass2.kt.after | 9 + .../function/functionAtClassInitializer1.kt | 9 + .../functionAtClassInitializer1.kt.after | 9 + .../function/functionAtClassInitializer2.kt | 9 + .../functionAtClassInitializer2.kt.after | 9 + .../function/functionAtEmptyLine1.kt | 8 + .../function/functionAtEmptyLine1.kt.after | 8 + .../function/functionAtEmptyLine2.kt | 8 + .../function/functionAtEmptyLine2.kt.after | 8 + .../function/functionAtFunction1.kt | 9 + .../function/functionAtFunction1.kt.after | 9 + .../function/functionAtFunction2.kt | 9 + .../function/functionAtFunction2.kt.after | 9 + .../function/functionAtProperty1.kt | 7 + .../function/functionAtProperty1.kt.after | 7 + .../function/functionAtProperty2.kt | 7 + .../function/functionAtProperty2.kt.after | 7 + .../property/propertyAtBrace1.kt | 6 + .../property/propertyAtBrace1.kt.after | 6 + .../property/propertyAtBrace2.kt | 6 + .../property/propertyAtBrace2.kt.after | 6 + .../property/propertyAtBrace3.kt | 6 + .../property/propertyAtBrace3.kt.after | 6 + .../property/propertyAtBrace4.kt | 6 + .../property/propertyAtBrace4.kt.after | 6 + .../property/propertyAtBrace5.kt | 7 + .../property/propertyAtBrace6.kt | 7 + .../property/propertyAtClass1.kt | 7 + .../property/propertyAtClass1.kt.after | 7 + .../property/propertyAtClass2.kt | 7 + .../property/propertyAtClass2.kt.after | 7 + .../property/propertyAtClassInitializer1.kt | 7 + .../propertyAtClassInitializer1.kt.after | 7 + .../property/propertyAtClassInitializer2.kt | 7 + .../propertyAtClassInitializer2.kt.after | 7 + .../property/propertyAtEmptyLine1.kt | 6 + .../property/propertyAtEmptyLine1.kt.after | 6 + .../property/propertyAtEmptyLine2.kt | 6 + .../property/propertyAtEmptyLine2.kt.after | 6 + .../property/propertyAtFunction1.kt | 7 + .../property/propertyAtFunction1.kt.after | 7 + .../property/propertyAtFunction2.kt | 7 + .../property/propertyAtFunction2.kt.after | 7 + .../property/propertyAtProperty1.kt | 5 + .../property/propertyAtProperty1.kt.after | 5 + .../property/propertyAtProperty2.kt | 5 + .../property/propertyAtProperty2.kt.after | 5 + .../moveUpDown/AbstractCodeMoverTest.java | 87 ++++ .../moveUpDown/CodeMoverTestGenerated.java | 458 ++++++++++++++++++ 136 files changed, 1900 insertions(+) create mode 100644 idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/AbstractJetUpDownMover.java create mode 100644 idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum3.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt.after create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt create mode 100644 idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt.after create mode 100644 idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/AbstractCodeMoverTest.java create mode 100644 idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/CodeMoverTestGenerated.java diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java index 1dce4c753ad..3d40cdd11c1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassInitializer.java @@ -17,7 +17,10 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.lexer.JetTokens; public class JetClassInitializer extends JetDeclarationImpl implements JetStatementExpression { public JetClassInitializer(@NotNull ASTNode node) { @@ -40,4 +43,11 @@ public class JetClassInitializer extends JetDeclarationImpl implements JetStatem assert body != null; return body; } + + @NotNull + public PsiElement getOpenBraceNode() { + ASTNode openBraceNode = getNode().findChildByType(JetTokens.LBRACE); + assert openBraceNode != null; + return openBraceNode.getPsi(); + } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassObject.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassObject.java index 4d12d816e2a..e2169addfa0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassObject.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClassObject.java @@ -17,9 +17,11 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.JetNodeTypes; +import org.jetbrains.jet.lexer.JetTokens; public class JetClassObject extends JetDeclarationImpl implements JetStatementExpression { public JetClassObject(@NotNull ASTNode node) { @@ -41,4 +43,9 @@ public class JetClassObject extends JetDeclarationImpl implements JetStatementEx return (JetObjectDeclaration) findChildByType(JetNodeTypes.OBJECT_DECLARATION); } + @Nullable @IfNotParsed + public PsiElement getClassKeywordNode() { + ASTNode keywordNode = getNode().findChildByType(JetTokens.CLASS_KEYWORD); + return keywordNode != null ? keywordNode.getPsi() : null; + } } diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index 4971a06f9cf..46224ddf2f9 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -32,6 +32,7 @@ import org.jetbrains.jet.completion.AbstractJavaWithLibCompletionTest; import org.jetbrains.jet.completion.AbstractJetJSCompletionTest; import org.jetbrains.jet.completion.AbstractKeywordCompletionTest; import org.jetbrains.jet.jvm.compiler.*; +import org.jetbrains.jet.plugin.codeInsight.moveUpDown.AbstractCodeMoverTest; import org.jetbrains.jet.psi.AbstractJetPsiMatcherTest; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest; @@ -338,6 +339,13 @@ public class GenerateTests { testModelWithDirectories("idea/testData/hierarchy/class/super", "doSuperClassHierarchyTest"), testModelWithDirectories("idea/testData/hierarchy/class/sub", "doSubClassHierarchyTest") ); + + generateTest( + "idea/tests/", + "CodeMoverTestGenerated", + AbstractCodeMoverTest.class, + testModel("idea/testData/codeInsight/moveUpDown/classBodyDeclarations", "doTestClassBodyDeclaration") + ); } private static SimpleTestClassModel testModel(@NotNull String rootPath) { diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index f1e7fd11e46..18f3e23205a 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -283,6 +283,10 @@ serviceImplementation="org.jetbrains.jet.plugin.editor.JetEditorOptions"/> + + org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction Kotlin diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/AbstractJetUpDownMover.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/AbstractJetUpDownMover.java new file mode 100644 index 00000000000..5c1b3851294 --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/AbstractJetUpDownMover.java @@ -0,0 +1,63 @@ +package org.jetbrains.jet.plugin.codeInsight.upDownMover; + +import com.intellij.codeInsight.editorActions.moveUpDown.LineMover; +import com.intellij.codeInsight.editorActions.moveUpDown.LineRange; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiWhiteSpace; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.lang.psi.JetFile; + +public abstract class AbstractJetUpDownMover extends LineMover { + protected AbstractJetUpDownMover() { + } + + protected static PsiElement adjustWhiteSpaceSibling( + @NotNull Editor editor, + @NotNull LineRange sourceRange, + @NotNull MoveInfo info, + boolean down + ) { + PsiElement sibling = down ? sourceRange.lastElement.getNextSibling() : sourceRange.firstElement.getPrevSibling(); + + if (sibling instanceof PsiWhiteSpace) { + Document doc = editor.getDocument(); + TextRange spaceRange = sibling.getTextRange(); + + int startLine = doc.getLineNumber(spaceRange.getStartOffset()); + int endLine = doc.getLineNumber(spaceRange.getEndOffset()); + + if (endLine - startLine > 1) { + int nearLine = down ? sourceRange.endLine : sourceRange.startLine - 1; + + info.toMove = sourceRange; + info.toMove2 = new LineRange(nearLine, nearLine + 1); + + return null; + } + + sibling = firstNonWhiteElement(sibling, down); + } + + if (sibling == null) { + info.toMove2 = null; + return null; + } + + return sibling; + } + + @Nullable + protected static PsiElement firstNonWhiteSibling(@NotNull LineRange lineRange, boolean down) { + return firstNonWhiteElement(down ? lineRange.lastElement.getNextSibling() : lineRange.firstElement.getPrevSibling(), down); + } + + @Override + public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) { + return (file instanceof JetFile) && super.checkAvailable(editor, file, info, down); + } +} diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java new file mode 100644 index 00000000000..f720fd312b2 --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java @@ -0,0 +1,263 @@ +package org.jetbrains.jet.plugin.codeInsight.upDownMover; + +import com.intellij.codeInsight.editorActions.moveUpDown.LineRange; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.*; +import com.intellij.psi.util.PsiTreeUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.lang.psi.*; +import org.jetbrains.jet.lexer.JetTokens; + +import java.util.ArrayList; +import java.util.List; + +public class JetDeclarationMover extends AbstractJetUpDownMover { + public JetDeclarationMover() { + } + + @NotNull + private static List getDeclarationAnchors(@NotNull JetDeclaration declaration) { + final List memberSuspects = new ArrayList(); + + JetModifierList modifierList = declaration.getModifierList(); + if (modifierList != null) memberSuspects.add(modifierList); + + if (declaration instanceof JetNamedDeclaration) { + PsiElement nameIdentifier = ((JetNamedDeclaration) declaration).getNameIdentifier(); + if (nameIdentifier != null) memberSuspects.add(nameIdentifier); + } + + declaration.accept( + new JetVisitorVoid() { + @Override + public void visitAnonymousInitializer(JetClassInitializer initializer) { + memberSuspects.add(initializer.getOpenBraceNode()); + } + + @Override + public void visitClassObject(JetClassObject classObject) { + PsiElement classKeyword = classObject.getClassKeywordNode(); + if (classKeyword != null) memberSuspects.add(classKeyword); + } + + @Override + public void visitNamedFunction(JetNamedFunction function) { + PsiElement equalsToken = function.getEqualsToken(); + if (equalsToken != null) memberSuspects.add(equalsToken); + + JetParameterList parameterList = function.getValueParameterList(); + if (parameterList != null) memberSuspects.add(parameterList); + + JetTypeParameterList typeParameterList = function.getTypeParameterList(); + if (typeParameterList != null) memberSuspects.add(typeParameterList); + + JetTypeReference receiverTypeRef = function.getReceiverTypeRef(); + if (receiverTypeRef != null) memberSuspects.add(receiverTypeRef); + + JetTypeReference returnTypeRef = function.getReturnTypeRef(); + if (returnTypeRef != null) memberSuspects.add(returnTypeRef); + } + + @Override + public void visitProperty(JetProperty property) { + PsiElement valOrVarNode = property.getValOrVarNode().getPsi(); + if (valOrVarNode != null) memberSuspects.add(valOrVarNode); + + JetTypeParameterList typeParameterList = property.getTypeParameterList(); + if (typeParameterList != null) memberSuspects.add(typeParameterList); + + JetTypeReference receiverTypeRef = property.getReceiverTypeRef(); + if (receiverTypeRef != null) memberSuspects.add(receiverTypeRef); + + JetTypeReference returnTypeRef = property.getTypeRef(); + if (returnTypeRef != null) memberSuspects.add(returnTypeRef); + } + } + ); + + return memberSuspects; + } + + @Nullable + private static LineRange adjustDeclarationRange( + @NotNull JetDeclaration declaration, + @NotNull Editor editor, + @NotNull LineRange lineRange + ) { + Document doc = editor.getDocument(); + TextRange textRange = declaration.getTextRange(); + if (doc.getTextLength() < textRange.getEndOffset()) return null; + + int startLine = editor.offsetToLogicalPosition(textRange.getStartOffset()).line; + int endLine = editor.offsetToLogicalPosition(textRange.getEndOffset()).line + 1; + + if (startLine == lineRange.startLine || startLine == lineRange.endLine + || endLine == lineRange.startLine || endLine == lineRange.endLine) { + return new LineRange(startLine, endLine); + } + + TextRange lineTextRange = new TextRange(doc.getLineStartOffset(lineRange.startLine), + doc.getLineEndOffset(lineRange.endLine)); + for (PsiElement anchor : getDeclarationAnchors(declaration)) { + TextRange suspectTextRange = anchor.getTextRange(); + if (suspectTextRange != null && lineTextRange.intersects(suspectTextRange)) return new LineRange(startLine, endLine); + } + + return null; + } + + private static final Class[] DECLARATION_CONTAINER_CLASSES = + {JetClassBody.class, JetClassInitializer.class, JetFunction.class, JetPropertyAccessor.class, JetFile.class}; + + private static final Class[] CLASSBODYLIKE_DECLARATION_CONTAINER_CLASSES = {JetClassBody.class, JetFile.class}; + + @Nullable + private static JetDeclaration getMovableDeclaration(@Nullable PsiElement element) { + if (element == null) return null; + + JetDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetDeclaration.class, false); + + return PsiTreeUtil.instanceOf(PsiTreeUtil.getParentOfType(declaration, + DECLARATION_CONTAINER_CLASSES), + CLASSBODYLIKE_DECLARATION_CONTAINER_CLASSES) ? declaration : null; + } + + @Nullable + private static LineRange getSourceRange( + @NotNull JetDeclaration firstDecl, + @NotNull JetDeclaration lastDecl, + @NotNull Editor editor, + @NotNull LineRange oldRange + ) { + if (firstDecl == lastDecl) { + LineRange range = adjustDeclarationRange(firstDecl, editor, oldRange); + + if (range != null) { + range.firstElement = range.lastElement = firstDecl; + } + + return range; + } + + PsiElement parent = PsiTreeUtil.findCommonParent(firstDecl, lastDecl); + if (parent == null) return null; + + Pair combinedRange = getElementRange(parent, firstDecl, lastDecl); + + if (combinedRange == null + || !(combinedRange.first instanceof JetDeclaration) + || !(combinedRange.second instanceof JetDeclaration)) { + return null; + } + + LineRange lineRange1 = adjustDeclarationRange((JetDeclaration) combinedRange.getFirst(), editor, oldRange); + if (lineRange1 == null) return null; + + LineRange lineRange2 = adjustDeclarationRange((JetDeclaration) combinedRange.getSecond(), editor, oldRange); + if (lineRange2 == null) return null; + + LineRange range = new LineRange(lineRange1.startLine, lineRange2.endLine); + range.firstElement = combinedRange.getFirst(); + range.lastElement = combinedRange.getSecond(); + + return range; + } + + @Nullable + private static LineRange getTargetRange( + @NotNull Editor editor, + @NotNull PsiElement sibling, + boolean down, + @NotNull PsiElement target + ) { + PsiElement start = sibling; + PsiElement end = sibling; + + PsiElement nextParent = null; + + // moving out of code block + if (sibling.getNode().getElementType() == (down ? JetTokens.RBRACE : JetTokens.LBRACE)) { + // elements which aren't immediately placed in class body can't leave the block + PsiElement parent = sibling.getParent(); + if (!(parent instanceof JetClassBody)) return null; + + JetClassOrObject jetClassOrObject = (JetClassOrObject) parent.getParent(); + assert jetClassOrObject != null; + + nextParent = jetClassOrObject.getParent(); + + // elements may be placed only to class body or file + if (!(nextParent instanceof JetFile || nextParent instanceof JetClassBody)) return null; + + if (!down) { + start = jetClassOrObject; + } + } + // moving into code block + // element may move only into class body + else if (sibling instanceof JetClassOrObject) { + JetClassOrObject jetClassOrObject = (JetClassOrObject) sibling; + JetClassBody classBody = jetClassOrObject.getBody(); + + // confined elements can't leave their block + if (classBody != null) { + nextParent = classBody; + start = down ? jetClassOrObject : classBody.getRBrace(); + end = down ? classBody.getLBrace() : classBody.getRBrace(); + } + } + + if (nextParent != null) { + if (target instanceof JetClassInitializer && !(nextParent instanceof JetClassBody)) return null; + + if (target instanceof JetEnumEntry) { + if (!(nextParent instanceof JetClassBody)) return null; + + JetClassOrObject nextClassOrObject = (JetClassOrObject) nextParent.getParent(); + assert nextClassOrObject != null; + + if (!nextClassOrObject.hasModifier(JetTokens.ENUM_KEYWORD)) return null; + } + } + + if (target instanceof JetPropertyAccessor && !(sibling instanceof JetPropertyAccessor)) return null; + + return start != null && end != null ? new LineRange(start, end, editor.getDocument()) : null; + } + + @Override + public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) { + if (!super.checkAvailable(editor, file, info, down)) return false; + + LineRange oldRange = info.toMove; + + Pair psiRange = getElementRange(editor, file, oldRange); + if (psiRange == null) return false; + + JetDeclaration firstDecl = getMovableDeclaration(psiRange.getFirst()); + if (firstDecl == null) return false; + + JetDeclaration lastDecl = getMovableDeclaration(psiRange.getSecond()); + if (lastDecl == null) return false; + + //noinspection ConstantConditions + LineRange sourceRange = getSourceRange(firstDecl, lastDecl, editor, oldRange); + if (sourceRange == null) return false; + + PsiElement sibling = firstNonWhiteSibling(sourceRange, down); + + // Either reached last sibling, or jumped over multi-line whitespace + if (sibling == null) { + info.toMove2 = null; + return true; + } + + info.toMove = sourceRange; + info.toMove2 = getTargetRange(editor, sibling, down, sourceRange.firstElement); + return true; + } +} diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor1.kt new file mode 100644 index 00000000000..fe7f1e832c5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor1.kt @@ -0,0 +1,6 @@ +// MOVE: down +// IS_APPLICABLE: false +val x: String + get() { + return "" + } \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor2.kt new file mode 100644 index 00000000000..38bfcb856a4 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor2.kt @@ -0,0 +1,6 @@ +// MOVE: up +// IS_APPLICABLE: false +val x: String + get() { + return "" + } \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt new file mode 100644 index 00000000000..a49ddbd3b7b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt @@ -0,0 +1,8 @@ +// MOVE: down +var x: String + get() { + return "" + } + set(v: String) { + // test + } \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt.after new file mode 100644 index 00000000000..215dca40fdf --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +var x: String + set(v: String) { + // test + } + get() { + return "" + } diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt new file mode 100644 index 00000000000..bc8c11238fc --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt @@ -0,0 +1,8 @@ +// MOVE: up +var x: String + get() { + return "" + } + set(v: String) { + // test + } \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt.after new file mode 100644 index 00000000000..2282767b110 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +var x: String + set(v: String) { + // test + } + get() { + return "" + } diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt new file mode 100644 index 00000000000..f238eae366c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val x = "" + + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt.after new file mode 100644 index 00000000000..9c3c6850e8a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val x = "" + +} +class B { + +} diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt new file mode 100644 index 00000000000..4013210f036 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + class B { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt.after new file mode 100644 index 00000000000..016f4e20de3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class B { + +} +class A { + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt new file mode 100644 index 00000000000..4df12cc2365 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + class B { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt.after new file mode 100644 index 00000000000..eff2f26ab80 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + class B { + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt new file mode 100644 index 00000000000..9b3c200f843 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + class B { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt.after new file mode 100644 index 00000000000..af47bd31201 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class A { + class B { + + } + class B { + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt new file mode 100644 index 00000000000..5511821cbc4 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt @@ -0,0 +1,9 @@ +// MOVE: down +// IS_APPLICABLE: false +fun foo() { + class B { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt new file mode 100644 index 00000000000..711e905df5e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt @@ -0,0 +1,9 @@ +// MOVE: up +// IS_APPLICABLE: false +fun foo() { + class B { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt new file mode 100644 index 00000000000..df30122b176 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt.after new file mode 100644 index 00000000000..7c7fc272bdd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + class B { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt new file mode 100644 index 00000000000..27843d81cb1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt.after new file mode 100644 index 00000000000..1cb0fe81495 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt new file mode 100644 index 00000000000..9db424e8c1e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt.after new file mode 100644 index 00000000000..c5b81847fbf --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt new file mode 100644 index 00000000000..ff56bfabc8d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt.after new file mode 100644 index 00000000000..5dbb4935da5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt new file mode 100644 index 00000000000..5115c6bc9aa --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + class B { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt.after new file mode 100644 index 00000000000..af1e0f40e69 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val y = "" + + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt new file mode 100644 index 00000000000..3e3b8ba0d1e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + val x = "" + + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt.after new file mode 100644 index 00000000000..bdc0749a1cd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class A { + class B { + + } + + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt new file mode 100644 index 00000000000..505b9673e72 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt.after new file mode 100644 index 00000000000..5b76fe3bb9d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt new file mode 100644 index 00000000000..e864fe1af4c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + fun foo() { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt.after new file mode 100644 index 00000000000..793416b57de --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt new file mode 100644 index 00000000000..bb5a18b8488 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + class B { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt.after new file mode 100644 index 00000000000..c65358748f6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val y = "" + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt new file mode 100644 index 00000000000..fa7dd65a83e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + val y = "" + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt.after new file mode 100644 index 00000000000..805ab2a7edd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + class B { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace1.kt new file mode 100644 index 00000000000..2c6164d0151 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace1.kt @@ -0,0 +1,7 @@ +// MOVE: down +// IS_APPLICABLE: false +class B { + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace2.kt new file mode 100644 index 00000000000..d7618556f6d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace2.kt @@ -0,0 +1,7 @@ +// MOVE: up +// IS_APPLICABLE: false +class B { + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt new file mode 100644 index 00000000000..9018b8dec8b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt.after new file mode 100644 index 00000000000..d73569a6ee8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt new file mode 100644 index 00000000000..8b4afc7fcee --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt.after new file mode 100644 index 00000000000..2adf3bd6994 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt new file mode 100644 index 00000000000..4aa8284a1e5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt.after new file mode 100644 index 00000000000..19f70a7a811 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt new file mode 100644 index 00000000000..1f4c19053ca --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt.after new file mode 100644 index 00000000000..e4331ac665d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt new file mode 100644 index 00000000000..24c23194614 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt.after new file mode 100644 index 00000000000..7bf43a8bc70 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val y = "" + + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt new file mode 100644 index 00000000000..0db82eeed0a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + val x = "" + + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt.after new file mode 100644 index 00000000000..26c68820d05 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class A { + { + + } + + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt new file mode 100644 index 00000000000..320823670f7 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt.after new file mode 100644 index 00000000000..8f1498c5712 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt new file mode 100644 index 00000000000..b760f2b323f --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + fun foo() { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt.after new file mode 100644 index 00000000000..14466daa282 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt new file mode 100644 index 00000000000..311bfea21c7 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt.after new file mode 100644 index 00000000000..33e1b63aea3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val y = "" + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt new file mode 100644 index 00000000000..edc47ba9a63 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + val y = "" + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt.after new file mode 100644 index 00000000000..639531d527e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt new file mode 100644 index 00000000000..4ae012544bb --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt.after new file mode 100644 index 00000000000..c5204c15f7b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + enum class B { + Y + X + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum2.kt new file mode 100644 index 00000000000..bee76ae3993 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum2.kt @@ -0,0 +1,8 @@ +// MOVE: up +// IS_APPLICABLE: false +class A { + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum3.kt new file mode 100644 index 00000000000..174f5429afa --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum3.kt @@ -0,0 +1,8 @@ +// MOVE: down +// IS_APPLICABLE: false +class A { + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt new file mode 100644 index 00000000000..d4728baaea8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt.after new file mode 100644 index 00000000000..cbd8a807887 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + enum class B { + Y + X + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt new file mode 100644 index 00000000000..83702b078af --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt @@ -0,0 +1,10 @@ +// MOVE: up +enum class A { + U + V + + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt.after new file mode 100644 index 00000000000..cc4b4b404ae --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt.after @@ -0,0 +1,10 @@ +// MOVE: up +enum class A { + U + V + + X + enum class B { + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt new file mode 100644 index 00000000000..97a1cd07409 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt @@ -0,0 +1,10 @@ +// MOVE: down +enum class A { + U + V + + enum class B { + X + Y + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt.after new file mode 100644 index 00000000000..1b3cf977b69 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt.after @@ -0,0 +1,10 @@ +// MOVE: down +enum class A { + U + V + + enum class B { + X + } + Y +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt new file mode 100644 index 00000000000..da0d16d59c6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val x = "" + + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt.after new file mode 100644 index 00000000000..3e4844d3aca --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val x = "" + +} +fun foo() { + +} diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt new file mode 100644 index 00000000000..890a295d7c5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + fun foo() { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt.after new file mode 100644 index 00000000000..047bcb5dbe5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +fun foo() { + +} +class A { + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt new file mode 100644 index 00000000000..f6c03ac3d36 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt.after new file mode 100644 index 00000000000..6c850a5f3f0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + class B { + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt new file mode 100644 index 00000000000..d5e17c63f8a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt.after new file mode 100644 index 00000000000..862f49f1559 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class A { + fun foo() { + + } + class B { + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt new file mode 100644 index 00000000000..977102561eb --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt @@ -0,0 +1,9 @@ +// MOVE: down +// IS_APPLICABLE: false +fun foo() { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt new file mode 100644 index 00000000000..d3a54cf6fc1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt @@ -0,0 +1,9 @@ +// MOVE: up +// IS_APPLICABLE: false +fun foo() { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt new file mode 100644 index 00000000000..2cd599697ee --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt.after new file mode 100644 index 00000000000..451987e96c0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + fun foo() { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt new file mode 100644 index 00000000000..64a149bd3e6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt.after new file mode 100644 index 00000000000..bfe43bde50b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + class B { + + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt new file mode 100644 index 00000000000..49862cd92fa --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt.after new file mode 100644 index 00000000000..256788cf66a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt new file mode 100644 index 00000000000..69731c0828e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt.after new file mode 100644 index 00000000000..6277aed9f85 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + fun foo() { + + } + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt new file mode 100644 index 00000000000..4094dac0928 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt @@ -0,0 +1,8 @@ +// MOVE: down +class A { + fun foo() { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt.after new file mode 100644 index 00000000000..4e4d801f3b8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +class A { + val y = "" + + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt new file mode 100644 index 00000000000..7b24eec0b88 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt @@ -0,0 +1,8 @@ +// MOVE: up +class A { + val x = "" + + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt.after new file mode 100644 index 00000000000..b7a881772e1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +class A { + fun foo() { + + } + + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt new file mode 100644 index 00000000000..4c7bdd78a3c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt.after new file mode 100644 index 00000000000..fec94704f1f --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo() { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt new file mode 100644 index 00000000000..d019e81a5bb --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt @@ -0,0 +1,9 @@ +// MOVE: up +class A { + fun foo() { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt.after new file mode 100644 index 00000000000..93202aaf691 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt.after @@ -0,0 +1,9 @@ +// MOVE: up +class A { + fun foo() { + + } + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt new file mode 100644 index 00000000000..d8a3887b204 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + fun foo() { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt.after new file mode 100644 index 00000000000..8ea5a5d2fd8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val y = "" + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt new file mode 100644 index 00000000000..e013617ebc6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + val y = "" + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt.after new file mode 100644 index 00000000000..80a5ce4d34e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + fun foo() { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt new file mode 100644 index 00000000000..2ba360e9efe --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt @@ -0,0 +1,6 @@ +// MOVE: down +class A { + val x = "" + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt.after new file mode 100644 index 00000000000..660bf8af9e1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt.after @@ -0,0 +1,6 @@ +// MOVE: down +class A { + val x = "" + +} +val y = "" diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt new file mode 100644 index 00000000000..7f94c0ac8d8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt @@ -0,0 +1,6 @@ +// MOVE: up +class A { + val x = "" + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt.after new file mode 100644 index 00000000000..c47556639ea --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt.after @@ -0,0 +1,6 @@ +// MOVE: up +val x = "" +class A { + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt new file mode 100644 index 00000000000..3e5dbf4d82b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt @@ -0,0 +1,6 @@ +// MOVE: down +class A { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt.after new file mode 100644 index 00000000000..28def27d9bb --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt.after @@ -0,0 +1,6 @@ +// MOVE: down +class A { + class B { + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt new file mode 100644 index 00000000000..5e3c869f9b1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt @@ -0,0 +1,6 @@ +// MOVE: up +class A { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt.after new file mode 100644 index 00000000000..89d0876a81a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt.after @@ -0,0 +1,6 @@ +// MOVE: up +class A { + val y = "" + class B { + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt new file mode 100644 index 00000000000..97ca96de10c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt @@ -0,0 +1,7 @@ +// MOVE: down +// IS_APPLICABLE: false +fun foo() { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt new file mode 100644 index 00000000000..bfe83368b6b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt @@ -0,0 +1,7 @@ +// MOVE: up +// IS_APPLICABLE: false +fun foo() { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt new file mode 100644 index 00000000000..a4afb87fdf6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val x = "" + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt.after new file mode 100644 index 00000000000..7d20f71189c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + class B { + val x = "" + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt new file mode 100644 index 00000000000..4b483cc8c42 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + class B { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt.after new file mode 100644 index 00000000000..fd5185d4e3e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + class B { + + val x = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt new file mode 100644 index 00000000000..d34dca815da --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val x = "" + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt.after new file mode 100644 index 00000000000..ea29706876a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt new file mode 100644 index 00000000000..86d1b0124f6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt.after new file mode 100644 index 00000000000..56abf6d5b73 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + val x = "" + { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt new file mode 100644 index 00000000000..3143a3065e0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt @@ -0,0 +1,6 @@ +// MOVE: down +class A { + val x = "" + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt.after new file mode 100644 index 00000000000..ea331d0437f --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt.after @@ -0,0 +1,6 @@ +// MOVE: down +class A { + val y = "" + + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt new file mode 100644 index 00000000000..365cbec7f8c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt @@ -0,0 +1,6 @@ +// MOVE: up +class A { + val x = "" + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt.after new file mode 100644 index 00000000000..66a6c8aafb2 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt.after @@ -0,0 +1,6 @@ +// MOVE: up +class A { + val y = "" + + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt new file mode 100644 index 00000000000..86d43aa16b2 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt @@ -0,0 +1,7 @@ +// MOVE: down +class A { + val x = "" + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt.after new file mode 100644 index 00000000000..0398f74620d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +class A { + fun foo() { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt new file mode 100644 index 00000000000..28fbf893349 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt @@ -0,0 +1,7 @@ +// MOVE: up +class A { + fun foo() { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt.after new file mode 100644 index 00000000000..96a307f37dd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +class A { + val x = "" + fun foo() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt new file mode 100644 index 00000000000..d88a50f3ee2 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt @@ -0,0 +1,5 @@ +// MOVE: down +class A { + val x = "" + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt.after new file mode 100644 index 00000000000..e46e2f58701 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt.after @@ -0,0 +1,5 @@ +// MOVE: down +class A { + val y = "" + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt new file mode 100644 index 00000000000..df38ee26773 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt @@ -0,0 +1,5 @@ +// MOVE: up +class A { + val y = "" + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt.after new file mode 100644 index 00000000000..f139e2efebd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt.after @@ -0,0 +1,5 @@ +// MOVE: up +class A { + val x = "" + val y = "" +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/AbstractCodeMoverTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/AbstractCodeMoverTest.java new file mode 100644 index 00000000000..b1271d50891 --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/AbstractCodeMoverTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.plugin.codeInsight.moveUpDown; + +import com.intellij.codeInsight.editorActions.moveUpDown.MoveStatementDownAction; +import com.intellij.codeInsight.editorActions.moveUpDown.MoveStatementUpAction; +import com.intellij.codeInsight.editorActions.moveUpDown.StatementUpDownMover; +import com.intellij.openapi.editor.actionSystem.EditorAction; +import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.testFramework.LightCodeInsightTestCase; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.InTextDirectivesUtils; +import org.jetbrains.jet.plugin.codeInsight.upDownMover.JetDeclarationMover; + +import java.io.File; + +public abstract class AbstractCodeMoverTest extends LightCodeInsightTestCase { + public void doTestClassBodyDeclaration(@NotNull String path) throws Exception { + doTest(path, JetDeclarationMover.class); + } + + private void doTest(@NotNull String path, @NotNull Class moverClass) throws Exception { + configureByFile(path); + + String fileText = FileUtil.loadFile(new File(path)); + String direction = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// MOVE: "); + + boolean down = true; + if ("up".equals(direction)) { + down = false; + } + else if ("down".equals(direction)) { + down = true; + } + else { + fail("Direction is not specified"); + } + + String isApplicableString = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// IS_APPLICABLE: "); + boolean isApplicableExpected = isApplicableString == null || isApplicableString.equals("true"); + + StatementUpDownMover[] movers = Extensions.getExtensions(StatementUpDownMover.STATEMENT_UP_DOWN_MOVER_EP); + StatementUpDownMover.MoveInfo info = new StatementUpDownMover.MoveInfo(); + StatementUpDownMover actualMover = null; + for (StatementUpDownMover mover : movers) { + if (mover.checkAvailable(getEditor(), getFile(), info, down)) { + actualMover = mover; + break; + } + } + + assertTrue("No mover found", actualMover != null); + assertEquals("Unmatched movers", moverClass, actualMover.getClass()); + assertEquals("Invalid applicability", isApplicableExpected, info.toMove2 != null); + + if (isApplicableExpected) { + invokeAndCheck(path, down); + } + } + + private void invokeAndCheck(@NotNull String path, boolean down) { + EditorAction action = down ? new MoveStatementDownAction() : new MoveStatementUpAction(); + action.actionPerformed(getEditor(), getCurrentEditorDataContext()); + checkResultByFile(path + ".after"); + } + + @NotNull + @Override + protected String getTestDataPath() { + return ""; + } +} diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/CodeMoverTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/CodeMoverTestGenerated.java new file mode 100644 index 00000000000..44c810ed49d --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/CodeMoverTestGenerated.java @@ -0,0 +1,458 @@ +/* + * Copyright 2010-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.plugin.codeInsight.moveUpDown; + +import junit.framework.Assert; +import junit.framework.Test; +import junit.framework.TestSuite; + +import java.io.File; +import java.util.regex.Pattern; +import org.jetbrains.jet.JetTestUtils; +import org.jetbrains.jet.test.InnerTestClasses; +import org.jetbrains.jet.test.TestMetadata; + +import org.jetbrains.jet.plugin.codeInsight.moveUpDown.AbstractCodeMoverTest; + +/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@InnerTestClasses({CodeMoverTestGenerated.ClassBodyDeclarations.class}) +public class CodeMoverTestGenerated extends AbstractCodeMoverTest { + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations") + @InnerTestClasses({ClassBodyDeclarations.Accessors.class, ClassBodyDeclarations.Class.class, ClassBodyDeclarations.ClassInitializer.class, ClassBodyDeclarations.Enums.class, ClassBodyDeclarations.Function.class, ClassBodyDeclarations.Property.class}) + public static class ClassBodyDeclarations extends AbstractCodeMoverTest { + public void testAllFilesPresentInClassBodyDeclarations() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors") + public static class Accessors extends AbstractCodeMoverTest { + @TestMetadata("accessor1.kt") + public void testAccessor1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor1.kt"); + } + + @TestMetadata("accessor2.kt") + public void testAccessor2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor2.kt"); + } + + @TestMetadata("accessor3.kt") + public void testAccessor3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor3.kt"); + } + + @TestMetadata("accessor4.kt") + public void testAccessor4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors/accessor4.kt"); + } + + public void testAllFilesPresentInAccessors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/accessors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class") + public static class Class extends AbstractCodeMoverTest { + public void testAllFilesPresentInClass() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("classAtBrace1.kt") + public void testClassAtBrace1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace1.kt"); + } + + @TestMetadata("classAtBrace2.kt") + public void testClassAtBrace2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace2.kt"); + } + + @TestMetadata("classAtBrace3.kt") + public void testClassAtBrace3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace3.kt"); + } + + @TestMetadata("classAtBrace4.kt") + public void testClassAtBrace4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace4.kt"); + } + + @TestMetadata("classAtBrace5.kt") + public void testClassAtBrace5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt"); + } + + @TestMetadata("classAtBrace6.kt") + public void testClassAtBrace6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt"); + } + + @TestMetadata("classAtClass1.kt") + public void testClassAtClass1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass1.kt"); + } + + @TestMetadata("classAtClass2.kt") + public void testClassAtClass2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClass2.kt"); + } + + @TestMetadata("classAtClassInitializer1.kt") + public void testClassAtClassInitializer1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer1.kt"); + } + + @TestMetadata("classAtClassInitializer2.kt") + public void testClassAtClassInitializer2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtClassInitializer2.kt"); + } + + @TestMetadata("classAtEmptyLine1.kt") + public void testClassAtEmptyLine1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine1.kt"); + } + + @TestMetadata("classAtEmptyLine2.kt") + public void testClassAtEmptyLine2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtEmptyLine2.kt"); + } + + @TestMetadata("classAtFunction1.kt") + public void testClassAtFunction1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction1.kt"); + } + + @TestMetadata("classAtFunction2.kt") + public void testClassAtFunction2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtFunction2.kt"); + } + + @TestMetadata("classAtProperty1.kt") + public void testClassAtProperty1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty1.kt"); + } + + @TestMetadata("classAtProperty2.kt") + public void testClassAtProperty2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtProperty2.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer") + public static class ClassInitializer extends AbstractCodeMoverTest { + public void testAllFilesPresentInClassInitializer() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("classInitializerAtBrace1.kt") + public void testClassInitializerAtBrace1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace1.kt"); + } + + @TestMetadata("classInitializerAtBrace2.kt") + public void testClassInitializerAtBrace2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtBrace2.kt"); + } + + @TestMetadata("classInitializerAtClass1.kt") + public void testClassInitializerAtClass1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass1.kt"); + } + + @TestMetadata("classInitializerAtClass2.kt") + public void testClassInitializerAtClass2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClass2.kt"); + } + + @TestMetadata("classInitializerAtClassInitializer1.kt") + public void testClassInitializerAtClassInitializer1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer1.kt"); + } + + @TestMetadata("classInitializerAtClassInitializer2.kt") + public void testClassInitializerAtClassInitializer2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtClassInitializer2.kt"); + } + + @TestMetadata("classInitializerAtEmptyLine1.kt") + public void testClassInitializerAtEmptyLine1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine1.kt"); + } + + @TestMetadata("classInitializerAtEmptyLine2.kt") + public void testClassInitializerAtEmptyLine2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtEmptyLine2.kt"); + } + + @TestMetadata("classInitializerAtFunction1.kt") + public void testClassInitializerAtFunction1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction1.kt"); + } + + @TestMetadata("classInitializerAtFunction2.kt") + public void testClassInitializerAtFunction2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtFunction2.kt"); + } + + @TestMetadata("classInitializerAtProperty1.kt") + public void testClassInitializerAtProperty1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty1.kt"); + } + + @TestMetadata("classInitializerAtProperty2.kt") + public void testClassInitializerAtProperty2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/classInitializer/classInitializerAtProperty2.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums") + public static class Enums extends AbstractCodeMoverTest { + public void testAllFilesPresentInEnums() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("enum1.kt") + public void testEnum1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum1.kt"); + } + + @TestMetadata("enum2.kt") + public void testEnum2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum2.kt"); + } + + @TestMetadata("enum3.kt") + public void testEnum3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum3.kt"); + } + + @TestMetadata("enum4.kt") + public void testEnum4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum4.kt"); + } + + @TestMetadata("enum5.kt") + public void testEnum5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum5.kt"); + } + + @TestMetadata("enum6.kt") + public void testEnum6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/enums/enum6.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function") + public static class Function extends AbstractCodeMoverTest { + public void testAllFilesPresentInFunction() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("functionAtBrace1.kt") + public void testFunctionAtBrace1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace1.kt"); + } + + @TestMetadata("functionAtBrace2.kt") + public void testFunctionAtBrace2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace2.kt"); + } + + @TestMetadata("functionAtBrace3.kt") + public void testFunctionAtBrace3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace3.kt"); + } + + @TestMetadata("functionAtBrace4.kt") + public void testFunctionAtBrace4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace4.kt"); + } + + @TestMetadata("functionAtBrace5.kt") + public void testFunctionAtBrace5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt"); + } + + @TestMetadata("functionAtBrace6.kt") + public void testFunctionAtBrace6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt"); + } + + @TestMetadata("functionAtClass1.kt") + public void testFunctionAtClass1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass1.kt"); + } + + @TestMetadata("functionAtClass2.kt") + public void testFunctionAtClass2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClass2.kt"); + } + + @TestMetadata("functionAtClassInitializer1.kt") + public void testFunctionAtClassInitializer1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer1.kt"); + } + + @TestMetadata("functionAtClassInitializer2.kt") + public void testFunctionAtClassInitializer2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtClassInitializer2.kt"); + } + + @TestMetadata("functionAtEmptyLine1.kt") + public void testFunctionAtEmptyLine1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine1.kt"); + } + + @TestMetadata("functionAtEmptyLine2.kt") + public void testFunctionAtEmptyLine2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtEmptyLine2.kt"); + } + + @TestMetadata("functionAtFunction1.kt") + public void testFunctionAtFunction1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction1.kt"); + } + + @TestMetadata("functionAtFunction2.kt") + public void testFunctionAtFunction2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtFunction2.kt"); + } + + @TestMetadata("functionAtProperty1.kt") + public void testFunctionAtProperty1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty1.kt"); + } + + @TestMetadata("functionAtProperty2.kt") + public void testFunctionAtProperty2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtProperty2.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property") + public static class Property extends AbstractCodeMoverTest { + public void testAllFilesPresentInProperty() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("propertyAtBrace1.kt") + public void testPropertyAtBrace1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace1.kt"); + } + + @TestMetadata("propertyAtBrace2.kt") + public void testPropertyAtBrace2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace2.kt"); + } + + @TestMetadata("propertyAtBrace3.kt") + public void testPropertyAtBrace3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace3.kt"); + } + + @TestMetadata("propertyAtBrace4.kt") + public void testPropertyAtBrace4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace4.kt"); + } + + @TestMetadata("propertyAtBrace5.kt") + public void testPropertyAtBrace5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt"); + } + + @TestMetadata("propertyAtBrace6.kt") + public void testPropertyAtBrace6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt"); + } + + @TestMetadata("propertyAtClass1.kt") + public void testPropertyAtClass1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass1.kt"); + } + + @TestMetadata("propertyAtClass2.kt") + public void testPropertyAtClass2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClass2.kt"); + } + + @TestMetadata("propertyAtClassInitializer1.kt") + public void testPropertyAtClassInitializer1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer1.kt"); + } + + @TestMetadata("propertyAtClassInitializer2.kt") + public void testPropertyAtClassInitializer2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtClassInitializer2.kt"); + } + + @TestMetadata("propertyAtEmptyLine1.kt") + public void testPropertyAtEmptyLine1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine1.kt"); + } + + @TestMetadata("propertyAtEmptyLine2.kt") + public void testPropertyAtEmptyLine2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtEmptyLine2.kt"); + } + + @TestMetadata("propertyAtFunction1.kt") + public void testPropertyAtFunction1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction1.kt"); + } + + @TestMetadata("propertyAtFunction2.kt") + public void testPropertyAtFunction2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtFunction2.kt"); + } + + @TestMetadata("propertyAtProperty1.kt") + public void testPropertyAtProperty1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty1.kt"); + } + + @TestMetadata("propertyAtProperty2.kt") + public void testPropertyAtProperty2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtProperty2.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("ClassBodyDeclarations"); + suite.addTestSuite(ClassBodyDeclarations.class); + suite.addTestSuite(Accessors.class); + suite.addTestSuite(Class.class); + suite.addTestSuite(ClassInitializer.class); + suite.addTestSuite(Enums.class); + suite.addTestSuite(Function.class); + suite.addTestSuite(Property.class); + return suite; + } + } + + public static Test suite() { + TestSuite suite = new TestSuite("CodeMoverTestGenerated"); + suite.addTest(ClassBodyDeclarations.innerSuite()); + return suite; + } +}