diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java index 1d2166f6e60..7fb709deed9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java @@ -53,7 +53,7 @@ public class JetExpressionParsing extends AbstractJetParsing { TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, TRY_KEYWORD, ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, WHEN_KEYWORD, RBRACKET, RBRACE, RPAR, PLUSPLUS, MINUSMINUS, EXCLEXCL, -// MUL, + // MUL, PLUS, MINUS, EXCL, DIV, PERC, LTEQ, // TODO GTEQ, foo=x EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, SAFE_ACCESS, ELVIS, @@ -111,17 +111,17 @@ public class JetExpressionParsing extends AbstractJetParsing { ); private static final TokenSet STATEMENT_FIRST = TokenSet.orSet( - EXPRESSION_FIRST, - TokenSet.create( - // declaration - LBRACKET, // attribute - FUN_KEYWORD, - VAL_KEYWORD, VAR_KEYWORD, - TRAIT_KEYWORD, - CLASS_KEYWORD, - TYPE_KEYWORD - ), - MODIFIER_KEYWORDS + EXPRESSION_FIRST, + TokenSet.create( + // declaration + LBRACKET, // attribute + FUN_KEYWORD, + VAL_KEYWORD, VAR_KEYWORD, + TRAIT_KEYWORD, + CLASS_KEYWORD, + TYPE_KEYWORD + ), + MODIFIER_KEYWORDS ); /*package*/ static final TokenSet EXPRESSION_FOLLOW = TokenSet.create( @@ -174,7 +174,7 @@ public class JetExpressionParsing extends AbstractJetParsing { EQUALITY(EQEQ, EXCLEQ, EQEQEQ, EXCLEQEQEQ), CONJUNCTION(ANDAND), DISJUNCTION(OROR), -// ARROW(JetTokens.ARROW), + // ARROW(JetTokens.ARROW), ASSIGNMENT(EQ, PLUSEQ, MINUSEQ, MULTEQ, DIVEQ, PERCEQ), ; @@ -287,7 +287,7 @@ public class JetExpressionParsing extends AbstractJetParsing { * see the precedence table */ private void parseBinaryExpression(Precedence precedence) { -// System.out.println(precedence.name() + " at " + myBuilder.getTokenText()); + // System.out.println(precedence.name() + " at " + myBuilder.getTokenText()); PsiBuilder.Marker expression = mark(); @@ -300,7 +300,7 @@ public class JetExpressionParsing extends AbstractJetParsing { JetNodeType resultType = precedence.parseRightHandSide(operation, this); expression.done(resultType); - expression = expression.precede(); + expression = expression.precede(); } expression.drop(); @@ -310,7 +310,7 @@ public class JetExpressionParsing extends AbstractJetParsing { * operation? prefixExpression */ private void parsePrefixExpression() { -// System.out.println("pre at " + myBuilder.getTokenText()); + // System.out.println("pre at " + myBuilder.getTokenText()); if (at(LBRACKET)) { if (!parseLocalDeclaration()) { @@ -485,10 +485,10 @@ public class JetExpressionParsing extends AbstractJetParsing { */ protected boolean parseCallWithClosure() { boolean success = false; -// while (!myBuilder.newlineBeforeCurrentToken() -// && (at(LBRACE) + // while (!myBuilder.newlineBeforeCurrentToken() + // && (at(LBRACE) while ((at(LBRACE) - || atSet(LABELS) && lookahead(1) == LBRACE)) { + || atSet(LABELS) && lookahead(1) == LBRACE)) { if (!at(LBRACE)) { assert _atSet(LABELS); parsePrefixExpression(); @@ -520,7 +520,7 @@ public class JetExpressionParsing extends AbstractJetParsing { * ; */ private void parseAtomicExpression() { -// System.out.println("atom at " + myBuilder.getTokenText()); + // System.out.println("atom at " + myBuilder.getTokenText()); if (at(LPAR)) { parseParenthesizedExpression(); @@ -574,7 +574,7 @@ public class JetExpressionParsing extends AbstractJetParsing { parseDoWhile(); } else if (atSet(CLASS_KEYWORD, FUN_KEYWORD, VAL_KEYWORD, - VAR_KEYWORD, TYPE_KEYWORD)) { + VAR_KEYWORD, TYPE_KEYWORD)) { parseLocalDeclaration(); } else if (at(FIELD_IDENTIFIER)) { @@ -784,7 +784,7 @@ public class JetExpressionParsing extends AbstractJetParsing { if (!at(ARROW)) { errorUntil("Expecting '->'", TokenSet.create(ARROW, - RBRACE, EOL_OR_SEMICOLON)); + RBRACE, EOL_OR_SEMICOLON)); } if (at(ARROW)) { @@ -798,7 +798,7 @@ public class JetExpressionParsing extends AbstractJetParsing { } } else if (!atSet(WHEN_CONDITION_RECOVERY_SET)) { - errorAndAdvance("Expecting '->'"); + errorAndAdvance("Expecting '->'"); } } else { @@ -982,8 +982,8 @@ public class JetExpressionParsing extends AbstractJetParsing { parseFunctionLiteralParametersAndType(); paramsFound = preferParamsToExpressions ? - rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : - rollbackOrDropAt(rollbackMarker, ARROW); + rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : + rollbackOrDropAt(rollbackMarker, ARROW); } if (!paramsFound) { @@ -1047,8 +1047,8 @@ public class JetExpressionParsing extends AbstractJetParsing { } private boolean rollbackOrDrop(PsiBuilder.Marker rollbackMarker, - JetToken expected, String expectMessage, - IElementType validForDrop) { + JetToken expected, String expectMessage, + IElementType validForDrop) { if (at(expected)) { advance(); // dropAt rollbackMarker.drop(); @@ -1074,8 +1074,8 @@ public class JetExpressionParsing extends AbstractJetParsing { while (!eof()) { PsiBuilder.Marker parameter = mark(); -// int parameterNamePos = matchTokenStreamPredicate(new LastBefore(new At(IDENTIFIER), new AtOffset(doubleArrowPos))); -// createTruncatedBuilder(parameterNamePos).parseModifierList(MODIFIER_LIST, false); + // int parameterNamePos = matchTokenStreamPredicate(new LastBefore(new At(IDENTIFIER), new AtOffset(doubleArrowPos))); + // createTruncatedBuilder(parameterNamePos).parseModifierList(MODIFIER_LIST, false); expect(IDENTIFIER, "Expecting parameter name", TokenSet.create(ARROW)); @@ -1135,8 +1135,8 @@ public class JetExpressionParsing extends AbstractJetParsing { } return preferParamsToExpressions ? - rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : - rollbackOrDropAt(rollbackMarker, ARROW); + rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : + rollbackOrDropAt(rollbackMarker, ARROW); } private void parseFunctionLiteralParametersAndType() { @@ -1252,38 +1252,38 @@ public class JetExpressionParsing extends AbstractJetParsing { * ; */ private IElementType parseLocalDeclarationRest(boolean isEnum) { - IElementType keywordToken = tt(); - IElementType declType = null; - if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD) { - declType = myJetParsing.parseClass(isEnum); - } - else if (keywordToken == FUN_KEYWORD) { - declType = myJetParsing.parseFunction(); - } - else if (keywordToken == VAL_KEYWORD || keywordToken == VAR_KEYWORD) { - declType = myJetParsing.parseProperty(true); - } - else if (keywordToken == TYPE_KEYWORD) { - declType = myJetParsing.parseTypeDef(); - } - else if (keywordToken == OBJECT_KEYWORD) { - // Object expression may appear at the statement position: should parse it - // as expression instead of object declaration - // sample: - // { - // object : Thread() { - // } - // } - IElementType lookahead = lookahead(1); - if (lookahead == COLON || lookahead == LBRACE) { - return null; - } - - myJetParsing.parseObject(true, true); - declType = OBJECT_DECLARATION; - } - return declType; - } + IElementType keywordToken = tt(); + IElementType declType = null; + if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD) { + declType = myJetParsing.parseClass(isEnum); + } + else if (keywordToken == FUN_KEYWORD) { + declType = myJetParsing.parseFunction(); + } + else if (keywordToken == VAL_KEYWORD || keywordToken == VAR_KEYWORD) { + declType = myJetParsing.parseProperty(true); + } + else if (keywordToken == TYPE_KEYWORD) { + declType = myJetParsing.parseTypeDef(); + } + else if (keywordToken == OBJECT_KEYWORD) { + // Object expression may appear at the statement position: should parse it + // as expression instead of object declaration + // sample: + // { + // object : Thread() { + // } + // } + IElementType lookahead = lookahead(1); + if (lookahead == COLON || lookahead == LBRACE) { + return null; + } + + myJetParsing.parseObject(true, true); + declType = OBJECT_DECLARATION; + } + return declType; + } /* * doWhile diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java index dd519065f11..a56cd115ef9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -50,6 +50,7 @@ public class JetParsing extends AbstractJetParsing { private static final TokenSet IMPORT_RECOVERY_SET = TokenSet.create(AS_KEYWORD, DOT, EOL_OR_SEMICOLON); /*package*/ static final TokenSet TYPE_REF_FIRST = TokenSet.create(LBRACKET, IDENTIFIER, FUN_KEYWORD, LPAR, CAPITALIZED_THIS_KEYWORD, HASH); private static final TokenSet RECEIVER_TYPE_TERMINATORS = TokenSet.create(DOT, SAFE_ACCESS); + private static final TokenSet VALUE_PARAMETER_FIRST = TokenSet.orSet(TokenSet.create(IDENTIFIER, LBRACKET), MODIFIER_KEYWORDS); static JetParsing createForTopLevel(SemanticWhitespaceAwarePsiBuilder builder) { JetParsing jetParsing = new JetParsing(builder); @@ -1722,8 +1723,10 @@ public class JetParsing extends AbstractJetParsing { else { parseValueParameter(); } - if (!at(COMMA)) break; - advance(); // COMMA + if (at(COMMA)) { + advance(); // COMMA + } + else if (!atSet(VALUE_PARAMETER_FIRST)) break; } } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBlockExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBlockExpression.java index 6ab402a5e88..bbceac0a464 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBlockExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetBlockExpression.java @@ -54,7 +54,17 @@ public class JetBlockExpression extends JetExpressionImpl implements JetStatemen @Nullable public TextRange getLastBracketRange() { - PsiElement rBrace = findChildByType(JetTokens.RBRACE); + PsiElement rBrace = getRBrace(); return rBrace != null ? rBrace.getTextRange() : null; } + + @Nullable + public PsiElement getRBrace() { + return findChildByType(JetTokens.RBRACE); + } + + @Nullable + public PsiElement getLBrace() { + return findChildByType(JetTokens.LBRACE); + } } 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..0f681f4ba1e 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,10 @@ public class JetClassInitializer extends JetDeclarationImpl implements JetStatem assert body != null; return body; } + + @Nullable + public PsiElement getOpenBraceNode() { + JetExpression body = getBody(); + return (body instanceof JetBlockExpression) ? ((JetBlockExpression) body).getLBrace() : null; + } } 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/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java index c9f83314700..22a15e9a39f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiFactory.java @@ -73,6 +73,13 @@ public class JetPsiFactory { return star; } + @NotNull + public static PsiElement createComma(Project project) { + PsiElement comma = createType(project, "T").findElementAt(3); + assert comma != null; + return comma; + } + //the pair contains the first and the last elements of a range public static Pair createColonAndWhiteSpaces(Project project) { JetProperty property = createProperty(project, "val x : Int"); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java index 379a1e36630..7f1f7e3093e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java @@ -756,6 +756,65 @@ public class JetPsiUtil { return CommentUtilCore.isComment(element) || element instanceof KDocElement; } + @Nullable + public static PsiElement getOutermostParent(@NotNull PsiElement element, @NotNull PsiElement upperBound, boolean strict) { + PsiElement parent = strict ? element.getParent() : element; + while (parent != null && parent.getParent() != upperBound) { + parent = parent.getParent(); + } + + return parent; + } + + public static T getLastChildByType(@NotNull PsiElement root, @NotNull Class... elementTypes) { + PsiElement[] children = root.getChildren(); + + for (int i = children.length - 1; i >= 0; i--) { + if (PsiTreeUtil.instanceOf(children[i], elementTypes)) { + //noinspection unchecked + return (T) children[i]; + } + } + + return null; + } + + @Nullable + public static T getOutermostJetElement( + @Nullable PsiElement root, + boolean first, + @NotNull final Class... elementTypes + ) { + if (!(root instanceof JetElement)) return null; + + final List results = Lists.newArrayList(); + + ((JetElement) root).accept( + new JetVisitorVoid() { + @Override + public void visitJetElement(JetElement element) { + if (PsiTreeUtil.instanceOf(element, elementTypes)) { + //noinspection unchecked + results.add((T) element); + } + else { + element.acceptChildren(this); + } + } + } + ); + + if (results.isEmpty()) return null; + + return first ? results.get(0) : results.get(results.size() - 1); + } + + @Nullable + public static PsiElement findChildByType(@NotNull PsiElement element, @NotNull IElementType type) { + ASTNode node = element.getNode().findChildByType(type); + return node == null ? null : node.getPsi(); + } + @Nullable public static JetExpression getCalleeExpressionIfAny(@NotNull JetExpression expression) { if (expression instanceof JetCallElement) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lexer/JetTokens.java b/compiler/frontend/src/org/jetbrains/jet/lexer/JetTokens.java index 6407280a4a1..0477cd27a1d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lexer/JetTokens.java +++ b/compiler/frontend/src/org/jetbrains/jet/lexer/JetTokens.java @@ -114,7 +114,7 @@ public interface JetTokens { JetToken SAFE_ACCESS = new JetToken("SAFE_ACCESS"); JetToken ELVIS = new JetToken("ELVIS"); // JetToken MAP = new JetToken("MAP"); -// JetToken FILTER = new JetToken("FILTER"); + // JetToken FILTER = new JetToken("FILTER"); JetToken QUEST = new JetToken("QUEST"); JetToken COLONCOLON = new JetToken("COLONCOLON"); JetToken COLON = new JetToken("COLON"); @@ -131,7 +131,7 @@ public interface JetTokens { JetToken HASH = new JetToken("HASH"); JetToken AT = new JetToken("AT"); JetToken ATAT = new JetToken("ATAT"); - + JetToken IDE_TEMPLATE_START = new JetToken("IDE_TEMPLATE_START"); JetToken IDE_TEMPLATE_END = new JetToken("IDE_TEMPLATE_END"); @@ -165,23 +165,23 @@ public interface JetTokens { JetKeywordToken FINAL_KEYWORD = JetKeywordToken.softKeyword("final"); TokenSet KEYWORDS = TokenSet.create(PACKAGE_KEYWORD, AS_KEYWORD, TYPE_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, - THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, - NULL_KEYWORD, - TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, - IN_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, - ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, TRY_KEYWORD, WHEN_KEYWORD, - NOT_IN, NOT_IS, CAPITALIZED_THIS_KEYWORD, AS_SAFE + THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, + NULL_KEYWORD, + TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, + IN_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, + ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, TRY_KEYWORD, WHEN_KEYWORD, + NOT_IN, NOT_IS, CAPITALIZED_THIS_KEYWORD, AS_SAFE ); TokenSet SOFT_KEYWORDS = TokenSet.create(IMPORT_KEYWORD, WHERE_KEYWORD, BY_KEYWORD, GET_KEYWORD, - SET_KEYWORD, ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, INNER_KEYWORD, ANNOTATION_KEYWORD, - OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, - CATCH_KEYWORD, FINALLY_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, REIFIED_KEYWORD + SET_KEYWORD, ABSTRACT_KEYWORD, ENUM_KEYWORD, OPEN_KEYWORD, INNER_KEYWORD, ANNOTATION_KEYWORD, + OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, + CATCH_KEYWORD, FINALLY_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, REIFIED_KEYWORD ); TokenSet MODIFIER_KEYWORDS = TokenSet.create(ABSTRACT_KEYWORD, ENUM_KEYWORD, - OPEN_KEYWORD, INNER_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, - PROTECTED_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, REIFIED_KEYWORD + OPEN_KEYWORD, INNER_KEYWORD, ANNOTATION_KEYWORD, OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, + PROTECTED_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, INLINE_KEYWORD, REIFIED_KEYWORD ); TokenSet WHITESPACES = TokenSet.create(TokenType.WHITE_SPACE); @@ -196,13 +196,13 @@ public interface JetTokens { TokenSet STRINGS = TokenSet.create(CHARACTER_LITERAL, REGULAR_STRING_PART); TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, EXCLEXCL, MUL, PLUS, - MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, - SAFE_ACCESS, ELVIS, -// MAP, FILTER, - COLON, - RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, - NOT_IN, NOT_IS, - IDENTIFIER, LABEL_IDENTIFIER, ATAT, AT); + MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR, + SAFE_ACCESS, ELVIS, + // MAP, FILTER, + COLON, + RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ, + NOT_IN, NOT_IS, + IDENTIFIER, LABEL_IDENTIFIER, ATAT, AT); TokenSet AUGMENTED_ASSIGNMENTS = TokenSet.create(PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ); TokenSet ALL_ASSIGNMENTS = TokenSet.create(EQ, PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ); diff --git a/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.kt b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.kt new file mode 100644 index 00000000000..38256a1b0e6 --- /dev/null +++ b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.kt @@ -0,0 +1,5 @@ +val x = foo( + a, + b + c +) \ No newline at end of file diff --git a/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt new file mode 100644 index 00000000000..76cd7f04939 --- /dev/null +++ b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt @@ -0,0 +1,32 @@ +JetFile: MissingCommaInValueArgumentList.kt + NAMESPACE_HEADER + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_ARGUMENT + BINARY_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace('\n ') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('c') + PsiErrorElement:Expecting an element + + PsiWhiteSpace('\n') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/MissingCommaInValueParameterList.kt b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.kt new file mode 100644 index 00000000000..88e4a6d115a --- /dev/null +++ b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.kt @@ -0,0 +1,7 @@ +fun foo( + a: Any, + b: Int + c: String +) { + +} \ No newline at end of file diff --git a/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt new file mode 100644 index 00000000000..6d69387549b --- /dev/null +++ b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt @@ -0,0 +1,44 @@ +JetFile: MissingCommaInValueParameterList.kt + NAMESPACE_HEADER + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace('\n') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index cdcda21f2e6..08afc8565f7 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -32,7 +32,8 @@ 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.lang.psi.AbstractJetPsiMatcherTest; +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; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveTest; @@ -213,10 +214,11 @@ public class GenerateTests { ); generateTest( - "compiler/tests/", + "idea/tests/", "JetPsiMatcherTest", AbstractJetPsiMatcherTest.class, - testModel("compiler/testData/psi/jetPsiMatcher", "doTestExpressions") + testModel("idea/testData/jetPsiMatcher/expressions", "doTestExpressions"), + testModel("idea/testData/jetPsiMatcher/types", "doTestTypes") ); generateTest( @@ -337,6 +339,15 @@ 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"), + testModel("idea/testData/codeInsight/moveUpDown/closingBraces", "doTestExpression"), + testModel("idea/testData/codeInsight/moveUpDown/expressions", "doTestExpression") + ); } private static SimpleTestClassModel testModel(@NotNull String rootPath) { diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index f1339a65932..a69c753cd4f 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -283,6 +283,14 @@ serviceImplementation="org.jetbrains.jet.plugin.editor.JetEditorOptions"/> + + + + org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction Kotlin diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/WhenUtils.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/WhenUtils.java index 8f97f83b2cf..cc79bb83b4a 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/WhenUtils.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/WhenUtils.java @@ -4,6 +4,7 @@ import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lexer.JetTokens; +import org.jetbrains.jet.plugin.util.JetPsiMatcher; import static org.jetbrains.jet.lang.psi.JetPsiUnparsingUtils.*; 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..1e81b14fa56 --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/AbstractJetUpDownMover.java @@ -0,0 +1,76 @@ +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.Editor; +import com.intellij.openapi.util.Pair; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import com.intellij.psi.util.PsiTreeUtil; +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 abstract boolean checkSourceElement(@NotNull PsiElement element); + protected abstract LineRange getElementSourceLineRange(@NotNull PsiElement element, @NotNull Editor editor, @NotNull LineRange oldRange); + + @Nullable + protected LineRange getSourceRange(@NotNull PsiElement firstElement, @NotNull PsiElement lastElement, @NotNull Editor editor, LineRange oldRange) { + if (firstElement == lastElement) { + LineRange sourceRange = getElementSourceLineRange(firstElement, editor, oldRange); + + if (sourceRange != null) { + sourceRange.firstElement = sourceRange.lastElement = firstElement; + } + + return sourceRange; + } + + PsiElement parent = PsiTreeUtil.findCommonParent(firstElement, lastElement); + if (parent == null) return null; + + Pair combinedRange = getElementRange(parent, firstElement, lastElement); + + if (combinedRange == null + || !checkSourceElement(combinedRange.first) + || !checkSourceElement(combinedRange.second)) { + return null; + } + + LineRange lineRange1 = getElementSourceLineRange(combinedRange.first, editor, oldRange); + if (lineRange1 == null) return null; + + LineRange lineRange2 = getElementSourceLineRange(combinedRange.second, editor, oldRange); + if (lineRange2 == null) return null; + + LineRange sourceRange = new LineRange(lineRange1.startLine, lineRange2.endLine); + sourceRange.firstElement = combinedRange.first; + sourceRange.lastElement = combinedRange.second; + + return sourceRange; + } + + @Nullable + protected static PsiElement getSiblingOfType(@NotNull PsiElement element, boolean down, @NotNull Class type) { + return down ? PsiTreeUtil.getNextSiblingOfType(element, type) : PsiTreeUtil.getPrevSiblingOfType(element, type); + } + + @Nullable + protected static PsiElement firstNonWhiteSibling(@NotNull LineRange lineRange, boolean down) { + return firstNonWhiteElement(down ? lineRange.lastElement.getNextSibling() : lineRange.firstElement.getPrevSibling(), down); + } + + @Nullable + protected static PsiElement firstNonWhiteSibling(@NotNull PsiElement element, boolean down) { + return firstNonWhiteElement(down ? element.getNextSibling() : element.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..ae95da053c8 --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java @@ -0,0 +1,225 @@ +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) { + PsiElement brace = initializer.getOpenBraceNode(); + if (brace != null) { + memberSuspects.add(brace); + } + } + + @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); + + 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; + } + + 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); + if (declaration instanceof JetTypeParameter) { + return getMovableDeclaration(declaration.getParent()); + } + + return PsiTreeUtil.instanceOf(PsiTreeUtil.getParentOfType(declaration, + DECLARATION_CONTAINER_CLASSES), + CLASSBODYLIKE_DECLARATION_CONTAINER_CLASSES) ? declaration : null; + } + + @Override + protected boolean checkSourceElement(@NotNull PsiElement element) { + return element instanceof JetDeclaration; + } + + @Override + protected LineRange getElementSourceLineRange(@NotNull PsiElement element, @NotNull Editor editor, @NotNull LineRange oldRange) { + JetDeclaration declaration = (JetDeclaration) element; + + 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 == oldRange.startLine || startLine == oldRange.endLine + || endLine == oldRange.startLine || endLine == oldRange.endLine) { + return new LineRange(startLine, endLine); + } + + TextRange lineTextRange = new TextRange(doc.getLineStartOffset(oldRange.startLine), + doc.getLineEndOffset(oldRange.endLine)); + for (PsiElement anchor : getDeclarationAnchors(declaration)) { + TextRange suspectTextRange = anchor.getTextRange(); + if (suspectTextRange != null && lineTextRange.intersects(suspectTextRange)) return new LineRange(startLine, endLine); + } + + return null; + } + + @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(); + + 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/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetExpressionMover.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetExpressionMover.java new file mode 100644 index 00000000000..438622f1c8b --- /dev/null +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetExpressionMover.java @@ -0,0 +1,448 @@ +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; + +public class JetExpressionMover extends AbstractJetUpDownMover { + public JetExpressionMover() { + } + + private final static Class[] MOVABLE_ELEMENT_CLASSES = {JetExpression.class, JetWhenEntry.class, JetValueArgument.class, PsiComment.class}; + + private final static Class[] BLOCKLIKE_ELEMENT_CLASSES = + {JetBlockExpression.class, JetWhenExpression.class, JetClassBody.class, JetFile.class}; + + private final static Class[] FUNCTIONLIKE_ELEMENT_CLASSES = + {JetFunction.class, JetPropertyAccessor.class, JetClassInitializer.class}; + + @Nullable + private static PsiElement getStandaloneClosingBrace(@NotNull PsiFile file, @NotNull Editor editor) { + LineRange range = getLineRangeFromSelection(editor); + if (range.endLine - range.startLine != 1) return null; + int offset = editor.getCaretModel().getOffset(); + Document document = editor.getDocument(); + int line = document.getLineNumber(offset); + int lineStartOffset = document.getLineStartOffset(line); + String lineText = document.getText().substring(lineStartOffset, document.getLineEndOffset(line)); + if (!lineText.trim().equals("}")) return null; + + return file.findElementAt(lineStartOffset + lineText.indexOf('}')); + } + + private static BraceStatus checkForMovableDownClosingBrace( + @NotNull PsiElement closingBrace, + @NotNull PsiElement block, + @NotNull Editor editor, + @NotNull MoveInfo info + ) { + PsiElement current = block; + PsiElement nextElement = null; + PsiElement nextExpression = null; + do { + PsiElement sibling = firstNonWhiteElement(current.getNextSibling(), true); + if (sibling != null && nextElement == null) { + nextElement = sibling; + } + + if (sibling instanceof JetExpression) { + nextExpression = sibling; + break; + } + + current = current.getParent(); + } + while (current != null && !(PsiTreeUtil.instanceOf(current, BLOCKLIKE_ELEMENT_CLASSES))); + + if (nextExpression == null) return BraceStatus.NOT_MOVABLE; + + Document doc = editor.getDocument(); + + info.toMove = new LineRange(closingBrace, closingBrace, doc); + info.toMove2 = new LineRange(nextElement, nextExpression); + info.indentSource = true; + + return BraceStatus.MOVABLE; + } + + private static BraceStatus checkForMovableUpClosingBrace( + @NotNull PsiElement closingBrace, + PsiElement block, + @NotNull Editor editor, + @NotNull MoveInfo info + ) { + //noinspection unchecked + PsiElement prev = JetPsiUtil.getLastChildByType(block, JetExpression.class); + if (prev == null) return BraceStatus.NOT_MOVABLE; + + Document doc = editor.getDocument(); + + info.toMove = new LineRange(closingBrace, closingBrace, doc); + info.toMove2 = new LineRange(prev, prev, doc); + info.indentSource = true; + + return BraceStatus.MOVABLE; + } + + private static enum BraceStatus { + NOT_FOUND, + MOVABLE, + NOT_MOVABLE + } + + // Returns null if standalone closing brace is not found + private static BraceStatus checkForMovableClosingBrace( + @NotNull Editor editor, + @NotNull PsiFile file, + @NotNull MoveInfo info, + boolean down + ) { + PsiElement closingBrace = getStandaloneClosingBrace(file, editor); + if (closingBrace == null) return BraceStatus.NOT_FOUND; + + PsiElement blockLikeElement = closingBrace.getParent(); + if (!(blockLikeElement instanceof JetBlockExpression)) return BraceStatus.NOT_MOVABLE; + + PsiElement blockParent = blockLikeElement.getParent(); + if (blockParent instanceof JetWhenEntry) return BraceStatus.NOT_FOUND; + if (PsiTreeUtil.instanceOf(blockParent, FUNCTIONLIKE_ELEMENT_CLASSES)) return BraceStatus.NOT_FOUND; + + PsiElement enclosingExpression = PsiTreeUtil.getParentOfType(blockLikeElement, JetExpression.class); + + if (enclosingExpression instanceof JetDoWhileExpression) return BraceStatus.NOT_MOVABLE; + + if (enclosingExpression instanceof JetIfExpression) { + JetIfExpression ifExpression = (JetIfExpression) enclosingExpression; + + if (blockLikeElement == ifExpression.getThen() && ifExpression.getElse() != null) return BraceStatus.NOT_MOVABLE; + } + + return down + ? checkForMovableDownClosingBrace(closingBrace, blockLikeElement, editor, info) + : checkForMovableUpClosingBrace(closingBrace, blockLikeElement, editor, info); + } + + @Nullable + private static JetBlockExpression findClosestBlock(@NotNull PsiElement anchor, boolean down) { + PsiElement current = PsiTreeUtil.getParentOfType(anchor, JetBlockExpression.class); + while (current != null) { + PsiElement parent = current.getParent(); + if (parent instanceof JetClassBody || + parent instanceof JetClassInitializer || + parent instanceof JetFunction || + parent instanceof JetProperty) { + return null; + } + + if (parent instanceof JetBlockExpression) return (JetBlockExpression) parent; + + PsiElement sibling = down ? current.getNextSibling() : current.getPrevSibling(); + if (sibling != null) { + //noinspection unchecked + JetBlockExpression block = JetPsiUtil.getOutermostJetElement(sibling, down, JetBlockExpression.class); + if (block != null) return block; + + current = sibling; + } + else { + current = parent; + } + } + + return null; + } + + @Nullable + private static LineRange getExpressionTargetRange(@NotNull Editor editor, @NotNull PsiElement sibling, boolean down) { + PsiElement start = sibling; + PsiElement end = sibling; + + // moving out of code block + if (sibling.getNode().getElementType() == (down ? JetTokens.RBRACE : JetTokens.LBRACE)) { + PsiElement parent = sibling.getParent(); + if (!(parent instanceof JetBlockExpression || parent instanceof JetFunctionLiteral)) return null; + + JetBlockExpression newBlock = findClosestBlock(sibling, down); + if (newBlock == null) return null; + + if (PsiTreeUtil.isAncestor(newBlock, parent, true)) { + PsiElement outermostParent = JetPsiUtil.getOutermostParent(parent, newBlock, true); + + if (down) { + end = outermostParent; + } + else { + start = outermostParent; + } + } + else { + if (down) { + end = newBlock.getLBrace(); + } + else { + start = newBlock.getRBrace(); + } + } + } + else { + // moving into code block + //noinspection unchecked + JetElement blockLikeElement = JetPsiUtil.getOutermostJetElement(sibling, down, JetBlockExpression.class, JetWhenExpression.class, JetClassBody.class); + if (blockLikeElement != null && + !(PsiTreeUtil.instanceOf(blockLikeElement.getParent(), FUNCTIONLIKE_ELEMENT_CLASSES))) { + if (blockLikeElement instanceof JetWhenExpression) { + //noinspection unchecked + blockLikeElement = JetPsiUtil.getOutermostJetElement(blockLikeElement, down, JetBlockExpression.class); + } + + if (blockLikeElement != null) { + if (down) { + end = JetPsiUtil.findChildByType(blockLikeElement, JetTokens.LBRACE); + } + else { + start = JetPsiUtil.findChildByType(blockLikeElement, JetTokens.RBRACE); + } + } + } + } + + return start != null && end != null ? new LineRange(start, end, editor.getDocument()) : null; + } + + @Nullable + private static LineRange getWhenEntryTargetRange(@NotNull Editor editor, @NotNull PsiElement sibling, boolean down) { + if (sibling.getNode().getElementType() == (down ? JetTokens.RBRACE : JetTokens.LBRACE) && + PsiTreeUtil.getParentOfType(sibling, JetWhenEntry.class) == null) { + return null; + } + + return new LineRange(sibling, sibling, editor.getDocument()); + } + + @Nullable + private LineRange getValueParamOrArgTargetRange(@NotNull Editor editor, @NotNull PsiElement elementToCheck, @NotNull PsiElement sibling, boolean down) { + PsiElement next = sibling; + + if (next.getNode().getElementType() == JetTokens.COMMA) { + next = firstNonWhiteSibling(next, down); + } + + LineRange range = (next instanceof JetParameter || next instanceof JetValueArgument) + ? new LineRange(next, next, editor.getDocument()) + : null; + + if (range != null) { + parametersOrArgsToMove = new Pair(elementToCheck, next); + } + + return range; + } + + @Nullable + private LineRange getTargetRange( + @NotNull Editor editor, + @Nullable PsiElement elementToCheck, + @NotNull PsiElement sibling, + boolean down + ) { + if (elementToCheck instanceof JetParameter || elementToCheck instanceof JetValueArgument) { + return getValueParamOrArgTargetRange(editor, elementToCheck, sibling, down); + } + + if (elementToCheck instanceof JetExpression || elementToCheck instanceof PsiComment) { + return getExpressionTargetRange(editor, sibling, down); + } + + if (elementToCheck instanceof JetWhenEntry) { + return getWhenEntryTargetRange(editor, sibling, down); + } + + return null; + } + + @Override + protected boolean checkSourceElement(@NotNull PsiElement element) { + return PsiTreeUtil.instanceOf(element, MOVABLE_ELEMENT_CLASSES); + } + + @Override + protected LineRange getElementSourceLineRange(@NotNull PsiElement element, @NotNull Editor editor, @NotNull LineRange oldRange) { + TextRange textRange = element.getTextRange(); + if (editor.getDocument().getTextLength() < textRange.getEndOffset()) return null; + + int startLine = editor.offsetToLogicalPosition(textRange.getStartOffset()).line; + int endLine = editor.offsetToLogicalPosition(textRange.getEndOffset()).line + 1; + + return new LineRange(startLine, endLine); + } + + @Nullable + private static PsiElement getMovableElement(@NotNull PsiElement element, boolean lookRight) { + PsiElement movableElement = PsiTreeUtil.getNonStrictParentOfType(element, MOVABLE_ELEMENT_CLASSES); + if (movableElement == null) return null; + + if (isBracelessBlock(movableElement)) { + movableElement = firstNonWhiteElement(lookRight ? movableElement.getLastChild() : movableElement.getFirstChild(), !lookRight); + } + + return movableElement; + } + + private static boolean isLastOfItsKind(@NotNull PsiElement element, boolean down) { + return getSiblingOfType(element, down, element.getClass()) == null; + } + + private static boolean isForbiddenMove(@NotNull PsiElement element, boolean down) { + if (element instanceof JetParameter || element instanceof JetValueArgument) { + return isLastOfItsKind(element, down); + } + + return false; + } + + private static boolean isBracelessBlock(@NotNull PsiElement element) { + if (!(element instanceof JetBlockExpression)) return false; + + JetBlockExpression block = (JetBlockExpression) element; + + return block.getLBrace() == null && block.getRBrace() == null; + } + + protected static PsiElement adjustWhiteSpaceSibling( + @NotNull Editor editor, + @NotNull LineRange sourceRange, + @NotNull MoveInfo info, + boolean down + ) { + PsiElement element = down ? sourceRange.lastElement : sourceRange.firstElement; + PsiElement sibling = down ? element.getNextSibling() : element.getPrevSibling(); + + PsiElement whiteSpaceTestSubject = sibling; + if (sibling == null) { + PsiElement parent = element.getParent(); + if (parent != null && isBracelessBlock(parent)) { + whiteSpaceTestSubject = down ? parent.getNextSibling() : parent.getPrevSibling(); + } + } + + if (whiteSpaceTestSubject instanceof PsiWhiteSpace) { + Document doc = editor.getDocument(); + TextRange spaceRange = whiteSpaceTestSubject.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); + info.indentTarget = false; + + return null; + } + + if (sibling != null) { + sibling = firstNonWhiteElement(sibling, down); + } + } + + if (sibling == null) { + info.toMove2 = null; + return null; + } + + return sibling; + } + + @Override + public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) { + parametersOrArgsToMove = null; + + if (!super.checkAvailable(editor, file, info, down)) return false; + + switch (checkForMovableClosingBrace(editor, file, info, down)) { + case NOT_MOVABLE: { + info.toMove2 = null; + return true; + } + case MOVABLE: return true; + default: break; + } + + LineRange oldRange = info.toMove; + + Pair psiRange = getElementRange(editor, file, oldRange); + if (psiRange == null) return false; + + //noinspection unchecked + PsiElement firstElement = getMovableElement(psiRange.getFirst(), false); + PsiElement lastElement = getMovableElement(psiRange.getSecond(), true); + + if (firstElement == null || lastElement == null) return false; + + if (isForbiddenMove(firstElement, down) || isForbiddenMove(lastElement, down)) { + info.toMove2 = null; + return true; + } + + if ((firstElement instanceof JetParameter || firstElement instanceof JetValueArgument) && PsiTreeUtil.isAncestor(lastElement, firstElement, false)) { + lastElement = firstElement; + } + + LineRange sourceRange = getSourceRange(firstElement, lastElement, editor, oldRange); + if (sourceRange == null) return false; + + PsiElement sibling = adjustWhiteSpaceSibling(editor, sourceRange, info, down); + + // Either reached last sibling, or jumped over multi-line whitespace + if (sibling == null) return true; + + info.toMove = sourceRange; + info.toMove2 = getTargetRange(editor, sourceRange.firstElement, sibling, down); + return true; + } + + @Nullable + private Pair parametersOrArgsToMove; + + private static PsiElement getComma(@NotNull PsiElement element) { + PsiElement sibling = firstNonWhiteSibling(element, true); + return sibling != null && (sibling.getNode().getElementType() == JetTokens.COMMA) ? sibling : null; + } + + private static void fixCommaIfNeeded(@NotNull PsiElement element, boolean willBeLast) { + PsiElement comma = getComma(element); + if (willBeLast && comma != null) { + comma.delete(); + } + else if (!willBeLast && comma == null) { + PsiElement parent = element.getParent(); + assert parent != null; + + parent.addAfter(JetPsiFactory.createComma(parent.getProject()), element); + } + } + + @Override + public void beforeMove(@NotNull Editor editor, @NotNull MoveInfo info, boolean down) { + if (parametersOrArgsToMove != null) { + PsiElement element1 = parametersOrArgsToMove.first; + PsiElement element2 = parametersOrArgsToMove.second; + + fixCommaIfNeeded(element1, down && isLastOfItsKind(element2, true)); + fixCommaIfNeeded(element2, !down && isLastOfItsKind(element1, true)); + + //noinspection ConstantConditions + PsiDocumentManager.getInstance(editor.getProject()).doPostponedOperationsAndUnblockDocument(editor.getDocument()); + } + } +} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiMatcher.java b/idea/src/org/jetbrains/jet/plugin/util/JetPsiMatcher.java similarity index 93% rename from compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiMatcher.java rename to idea/src/org/jetbrains/jet/plugin/util/JetPsiMatcher.java index 4c10080a68b..da964464410 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiMatcher.java +++ b/idea/src/org/jetbrains/jet/plugin/util/JetPsiMatcher.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.jetbrains.jet.lang.psi; +package org.jetbrains.jet.plugin.util; -import com.google.common.collect.Lists; import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.lang.psi.*; import java.util.Arrays; import java.util.List; @@ -61,6 +61,13 @@ public class JetPsiMatcher { } }; + private static final Predicate2 PARAMETER_TYPE_CHECKER = new Predicate2() { + @Override + public boolean apply(JetParameter param1, JetParameter param2) { + return checkElementMatch(param1.getTypeReference(), param2.getTypeReference()); + } + }; + private static boolean checkListMatch(List list1, List list2, Predicate2 checker) { int n = list1.size(); if (list2.size() != n) return false; @@ -204,7 +211,9 @@ public class JetPsiMatcher { public Boolean visitFunctionType(JetFunctionType type1, JetElement data) { JetFunctionType type2 = (JetFunctionType) data; - return checkListMatch(type1.getTypeArgumentsAsTypes(), type2.getTypeArgumentsAsTypes()); + return checkElementMatch(type1.getReceiverTypeRef(), type2.getReceiverTypeRef()) && + checkElementMatch(type1.getReturnTypeRef(), type2.getReturnTypeRef()) && + checkListMatch(type1.getParameters(), type2.getParameters(), PARAMETER_TYPE_CHECKER); } @Override 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..b2b6b8f865a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt @@ -0,0 +1,8 @@ +// MOVE: down +fun foo() { + class A { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt.after new file mode 100644 index 00000000000..c52276366e7 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace5.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +fun foo() { + class A { + } + 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..aa4e230f674 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt @@ -0,0 +1,8 @@ +// MOVE: up +fun foo() { + class A { + class B { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt.after new file mode 100644 index 00000000000..831f7025b08 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/class/classAtBrace6.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +fun foo() { + class B { + + } + class A { + } +} \ 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..fcd181dca97 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt @@ -0,0 +1,8 @@ +// MOVE: down +fun foo() { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt.after new file mode 100644 index 00000000000..794f2076261 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace5.kt.after @@ -0,0 +1,8 @@ +// MOVE: down +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..42314a50cc1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt @@ -0,0 +1,8 @@ +// MOVE: up +fun foo() { + class B { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt.after new file mode 100644 index 00000000000..1a3e7adb4c5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/function/functionAtBrace6.kt.after @@ -0,0 +1,8 @@ +// MOVE: up +fun foo() { + fun foo() { + + } + class B { + } +} \ 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/functionAnchors/keyword.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/keyword.kt new file mode 100644 index 00000000000..6150efb0be3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/keyword.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/functionAnchors/keyword.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/keyword.kt.after new file mode 100644 index 00000000000..d616e7db69a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/keyword.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/functionAnchors/name.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/name.kt new file mode 100644 index 00000000000..6150efb0be3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/name.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/functionAnchors/name.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/name.kt.after new file mode 100644 index 00000000000..d616e7db69a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/name.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/functionAnchors/returnType.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt new file mode 100644 index 00000000000..5f82e152611 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt @@ -0,0 +1,9 @@ +// MOVE: down +class A { + fun foo(): Unit { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt.after new file mode 100644 index 00000000000..47e320d8329 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +class A { + class B { + fun foo(): Unit { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt new file mode 100644 index 00000000000..76b00ab230e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt @@ -0,0 +1,15 @@ +// MOVE: down +class A { + fun foo<T, + U, + W>( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt.after new file mode 100644 index 00000000000..5599dc1ec8d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt.after @@ -0,0 +1,15 @@ +// MOVE: down +class A { + class B { + fun foo<T, + U, + W>( + b: Int, + a: Int, + c: Int + ) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt new file mode 100644 index 00000000000..06d46bf4afe --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt @@ -0,0 +1,15 @@ +// MOVE: down +class A { + fun foo, + W>( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt.after new file mode 100644 index 00000000000..717f68b8366 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt.after @@ -0,0 +1,15 @@ +// MOVE: down +class A { + class B { + fun foo, + W>( + b: Int, + a: Int, + c: Int + ) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt new file mode 100644 index 00000000000..57ea5dd84da --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt @@ -0,0 +1,15 @@ +// MOVE: down +class A { + fun foo>( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt.after new file mode 100644 index 00000000000..8fe9444b7d8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt.after @@ -0,0 +1,15 @@ +// MOVE: down +class A { + class B { + fun foo>( + b: Int, + a: Int, + c: Int + ) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt new file mode 100644 index 00000000000..7b11f2e4d49 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt @@ -0,0 +1,7 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + a, + b, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt.after new file mode 100644 index 00000000000..f9c60de097e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + a, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt new file mode 100644 index 00000000000..f9c60de097e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt @@ -0,0 +1,7 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + a, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt.after new file mode 100644 index 00000000000..3db2d20f7ac --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + c, + a +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs3.kt new file mode 100644 index 00000000000..6bd9df3b1dc --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs3.kt @@ -0,0 +1,8 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +// IS_APPLICABLE: false +val x = foo( + b, + c, + a +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt new file mode 100644 index 00000000000..b08d329c8b9 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt @@ -0,0 +1,7 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + c, + a +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt.after new file mode 100644 index 00000000000..ec326d77a59 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + a, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt new file mode 100644 index 00000000000..ec326d77a59 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt @@ -0,0 +1,7 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + b, + a, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt.after new file mode 100644 index 00000000000..5a760ce3e34 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +val x = foo( + a, + b, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs6.kt new file mode 100644 index 00000000000..abfadee7eeb --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs6.kt @@ -0,0 +1,8 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +// IS_APPLICABLE: false +val x = foo( + a, + b, + c +) \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt new file mode 100644 index 00000000000..ac59006eaae --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt @@ -0,0 +1,16 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt.after new file mode 100644 index 00000000000..061c5220a57 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt.after @@ -0,0 +1,16 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + a: Int, + b: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt new file mode 100644 index 00000000000..4300aa586f3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt @@ -0,0 +1,16 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt.after new file mode 100644 index 00000000000..216202bc19c --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt.after @@ -0,0 +1,16 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + c: Int, + a: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt new file mode 100644 index 00000000000..eb98175f5ba --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt @@ -0,0 +1,16 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + a: Int, + b: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt.after new file mode 100644 index 00000000000..d8a000b41a3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt.after @@ -0,0 +1,16 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt new file mode 100644 index 00000000000..e46e747c672 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt @@ -0,0 +1,16 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + c: Int + a: Int, + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt.after new file mode 100644 index 00000000000..73fef7e9453 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt.after @@ -0,0 +1,16 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +class A { + fun foo( + b: Int, + a: Int, + c: Int + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams5.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams5.kt new file mode 100644 index 00000000000..706e5b82cb1 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams5.kt @@ -0,0 +1,17 @@ +// MOVE: down +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +// IS_APPLICABLE: false +class A { + fun foo( + b: Int, + c: Int + a: Int, + ) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams6.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams6.kt new file mode 100644 index 00000000000..9fad3970685 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams6.kt @@ -0,0 +1,17 @@ +// MOVE: up +// MOVER_CLASS: org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover +// IS_APPLICABLE: false +class A { + fun foo( + b: Int, + c: Int + a: Int, + ) { + + } + class B { + + } +} \ 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..e2dfb807f51 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt @@ -0,0 +1,6 @@ +// MOVE: down +fun foo() { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt.after new file mode 100644 index 00000000000..8df651be8f5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace5.kt.after @@ -0,0 +1,6 @@ +// MOVE: down +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..ab18d34ca64 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt @@ -0,0 +1,6 @@ +// MOVE: up +fun foo() { + class B { + val y = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt.after new file mode 100644 index 00000000000..12853c9e00e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/property/propertyAtBrace6.kt.after @@ -0,0 +1,6 @@ +// MOVE: up +fun foo() { + val y = "" + class B { + } +} \ 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/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt new file mode 100644 index 00000000000..c13119db2c6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt @@ -0,0 +1,13 @@ +// MOVE: down +class A { + val x: String + get() { + return "" + } + set(v: String) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt.after new file mode 100644 index 00000000000..cc22dcc2c56 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt.after @@ -0,0 +1,13 @@ +// MOVE: down +class A { + class B { + val x: String + get() { + return "" + } + set(v: String) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt new file mode 100644 index 00000000000..93950581d05 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt @@ -0,0 +1,13 @@ +// MOVE: down +class A { + val x: String + get() { + return "" + } + set(v: String) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt.after new file mode 100644 index 00000000000..cd15135fd3d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt.after @@ -0,0 +1,13 @@ +// MOVE: down +class A { + class B { + val x: String + get() { + return "" + } + set(v: String) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt new file mode 100644 index 00000000000..22720ebaa89 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt @@ -0,0 +1,13 @@ +// MOVE: down +class A { + val x: String + get() { + return "" + } + set(v: String) { + + } + class B { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt.after b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt.after new file mode 100644 index 00000000000..a735c09f511 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.kt.after @@ -0,0 +1,13 @@ +// MOVE: down +class A { + class B { + val x: String + get() { + return "" + } + set(v: String) { + + } + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt new file mode 100644 index 00000000000..eae0ea27cec --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt @@ -0,0 +1,7 @@ +// MOVE: down +fun(n: Int) { + for (i in 0..n) { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt.after new file mode 100644 index 00000000000..756d6cee613 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +fun(n: Int) { + for (i in 0..n) { + + val x = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/for/for2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for2.kt new file mode 100644 index 00000000000..bf2aeb7c808 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/for/for2.kt @@ -0,0 +1,8 @@ +// MOVE: up +// IS_APPLICABLE: false +fun(n: Int) { + for (i in 0..n) { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt new file mode 100644 index 00000000000..43c0955ee28 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt @@ -0,0 +1,10 @@ +// MOVE: down +fun foo() { + val x = "" + + fun bar() { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt.after new file mode 100644 index 00000000000..d4a61584b82 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt.after @@ -0,0 +1,10 @@ +// MOVE: down +fun foo() { + val x = "" + + + fun bar() { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt new file mode 100644 index 00000000000..6a0f188cc34 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt @@ -0,0 +1,10 @@ +// MOVE: up +fun foo() { + val x = "" + + fun bar() { + + } + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt.after new file mode 100644 index 00000000000..d97ba5d9700 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt.after @@ -0,0 +1,10 @@ +// MOVE: up +fun foo() { + val x = "" + fun bar() { + + } + + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt new file mode 100644 index 00000000000..d4a61584b82 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt @@ -0,0 +1,10 @@ +// MOVE: down +fun foo() { + val x = "" + + + fun bar() { + + } + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt.after new file mode 100644 index 00000000000..a1c6e7fe4df --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt.after @@ -0,0 +1,10 @@ +// MOVE: down +fun foo() { + val x = "" + + + val y = "" + fun bar() { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt new file mode 100644 index 00000000000..d97ba5d9700 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt @@ -0,0 +1,10 @@ +// MOVE: up +fun foo() { + val x = "" + fun bar() { + + } + + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt.after new file mode 100644 index 00000000000..c1a02f68d84 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt.after @@ -0,0 +1,10 @@ +// MOVE: up +fun foo() { + fun bar() { + + } + val x = "" + + + val y = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt new file mode 100644 index 00000000000..a5583bc773f --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt @@ -0,0 +1,10 @@ +// MOVE: down +fun(n: Int) { + if (n > 0) { + + } + else { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt.after new file mode 100644 index 00000000000..5bca3816643 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt.after @@ -0,0 +1,10 @@ +// MOVE: down +fun(n: Int) { + if (n > 0) { + + } + else { + + val x = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/if/if2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if2.kt new file mode 100644 index 00000000000..0d5fcedafc0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if2.kt @@ -0,0 +1,11 @@ +// MOVE: up +// IS_APPLICABLE: false +fun(n: Int) { + if (n > 0) { + + } + else { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/if/if3.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if3.kt new file mode 100644 index 00000000000..ff9a2c7d9e2 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if3.kt @@ -0,0 +1,11 @@ +// MOVE: down +// IS_APPLICABLE: false +fun(n: Int) { + if (n > 0) { + + } + else { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/if/if4.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if4.kt new file mode 100644 index 00000000000..b738d13d3a9 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/if/if4.kt @@ -0,0 +1,11 @@ +// MOVE: up +// IS_APPLICABLE: false +fun(n: Int) { + if (n > 0) { + + } + else { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt new file mode 100644 index 00000000000..7373ab8af34 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt @@ -0,0 +1,11 @@ +// MOVE: down +fun foo(n: Int) { + if (n > 0) { + + } else { + + } + while (n > 0) { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt.after new file mode 100644 index 00000000000..9c43a1014cc --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt.after @@ -0,0 +1,11 @@ +// MOVE: down +fun foo(n: Int) { + if (n > 0) { + + } else { + + while (n > 0) { + + } + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested2.kt new file mode 100644 index 00000000000..9ae75a6dd88 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested2.kt @@ -0,0 +1,12 @@ +// MOVE: down +// IS_APPLICABLE: false +fun foo(n: Int) { + if (n > 0) { + + } else { + + } + while (n > 0) { + + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/when1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/when1.kt new file mode 100644 index 00000000000..37e4b329134 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/when1.kt @@ -0,0 +1,17 @@ +// IS_APPLICABLE: false +// MOVE: down + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/when2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/when2.kt new file mode 100644 index 00000000000..3e40febebf3 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/when2.kt @@ -0,0 +1,17 @@ +// IS_APPLICABLE: false +// MOVE: up + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry1.kt new file mode 100644 index 00000000000..3c5f5775bb8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry1.kt @@ -0,0 +1,17 @@ +// IS_APPLICABLE: false +// MOVE: down + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt new file mode 100644 index 00000000000..b3d25d5f744 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt.after new file mode 100644 index 00000000000..e23769f7213 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt.after @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + else -> { + + } + 1 -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt new file mode 100644 index 00000000000..d66681a0572 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt.after new file mode 100644 index 00000000000..ea3b376f7c6 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt.after @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + else -> { + + } + 1 -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt new file mode 100644 index 00000000000..39fe51c4565 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(n: Int) { + when (n) { + 0 -> { + + } + 1 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt.after new file mode 100644 index 00000000000..529d20f9b75 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt.after @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(n: Int) { + when (n) { + 1 -> { + + } + 0 -> { + + } + else -> { + + } + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt new file mode 100644 index 00000000000..f3a44d20769 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt @@ -0,0 +1,7 @@ +// MOVE: down +fun(n: Int) { + while (true) { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt.after b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt.after new file mode 100644 index 00000000000..99dd7cfaca5 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt.after @@ -0,0 +1,7 @@ +// MOVE: down +fun(n: Int) { + while (true) { + + val x = "" + } +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/while/while2.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while2.kt new file mode 100644 index 00000000000..254f34c7b1f --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while2.kt @@ -0,0 +1,8 @@ +// MOVE: up +// IS_APPLICABLE: false +fun(n: Int) { + while (true) { + + } + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/while/while3.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while3.kt new file mode 100644 index 00000000000..8adc8b57da9 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while3.kt @@ -0,0 +1,9 @@ +// MOVE: down +// IS_APPLICABLE: false +fun(n: Int) { + do { + + } + while (true) + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/closingBraces/while/while4.kt b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while4.kt new file mode 100644 index 00000000000..22af102194b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/closingBraces/while/while4.kt @@ -0,0 +1,9 @@ +// MOVE: up +// IS_APPLICABLE: false +fun(n: Int) { + do { + + } + while (true) + val x = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/If1.kt b/idea/testData/codeInsight/moveUpDown/expressions/If1.kt new file mode 100644 index 00000000000..dc363c3a5c9 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/If1.kt @@ -0,0 +1,11 @@ +// MOVE: down + +fun foo(x: Boolean) { + // test + if (x) { + + } + else { + + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/If1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/If1.kt.after new file mode 100644 index 00000000000..42673921651 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/If1.kt.after @@ -0,0 +1,11 @@ +// MOVE: down + +fun foo(x: Boolean) { + if (x) { + // test + + } + else { + + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt b/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt new file mode 100644 index 00000000000..ff51a8e408d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt @@ -0,0 +1,5 @@ +// MOVE: down +fun foo() { + // test + val x = "" +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt.after new file mode 100644 index 00000000000..7540c6285d0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt.after @@ -0,0 +1,5 @@ +// MOVE: down +fun foo() { + val x = "" + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt b/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt new file mode 100644 index 00000000000..4e791764e35 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt @@ -0,0 +1,5 @@ +// MOVE: up +fun foo() { + val x = "" + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt.after new file mode 100644 index 00000000000..e46650fce17 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt.after @@ -0,0 +1,5 @@ +// MOVE: up +fun foo() { + // test + val x = "" +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if2.kt b/idea/testData/codeInsight/moveUpDown/expressions/if2.kt new file mode 100644 index 00000000000..4517ef16f9b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if2.kt @@ -0,0 +1,10 @@ +// MOVE: up +fun foo(x: Boolean) { + if (x) { + + } + else { + + } + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if2.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/if2.kt.after new file mode 100644 index 00000000000..e88441309f2 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if2.kt.after @@ -0,0 +1,10 @@ +// MOVE: up +fun foo(x: Boolean) { + if (x) { + + } + else { + + // test + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if3.kt b/idea/testData/codeInsight/moveUpDown/expressions/if3.kt new file mode 100644 index 00000000000..c659bd2d03d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if3.kt @@ -0,0 +1,9 @@ +// MOVE: down + +fun foo(x: Boolean) { + if (x) { + // test + } + else { + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if3.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/if3.kt.after new file mode 100644 index 00000000000..54b18882ec8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if3.kt.after @@ -0,0 +1,9 @@ +// MOVE: down + +fun foo(x: Boolean) { + if (x) { + } + else { + // test + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if4.kt b/idea/testData/codeInsight/moveUpDown/expressions/if4.kt new file mode 100644 index 00000000000..63ffdabe366 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if4.kt @@ -0,0 +1,9 @@ +// MOVE: up + +fun foo(x: Boolean) { + if (x) { + } + else { + // test + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/if4.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/if4.kt.after new file mode 100644 index 00000000000..5483bf42414 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/if4.kt.after @@ -0,0 +1,9 @@ +// MOVE: up + +fun foo(x: Boolean) { + if (x) { + // test + } + else { + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt b/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt new file mode 100644 index 00000000000..26b312d0bac --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt @@ -0,0 +1,9 @@ +// MOVE: down +val t = baz( + a, + b, + c +) { + val v = "" + val w = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt.after new file mode 100644 index 00000000000..da4389c585a --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt.after @@ -0,0 +1,9 @@ +// MOVE: down +val t = baz( + a, + b, + c +) { + val w = "" + val v = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/lambda2.kt b/idea/testData/codeInsight/moveUpDown/expressions/lambda2.kt new file mode 100644 index 00000000000..f7acc8c8ac8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/lambda2.kt @@ -0,0 +1,10 @@ +// MOVE: up +// IS_APPLICABLE: false +val t = baz( + a, + b, + c +) { + val v = "" + val w = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt b/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt new file mode 100644 index 00000000000..ad70ab1e36b --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt @@ -0,0 +1,10 @@ +// MOVE: up +val t = baz( + a, + b, + c +) { + + val v = "" + val w = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt.after new file mode 100644 index 00000000000..dfcb8d8ba87 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt.after @@ -0,0 +1,10 @@ +// MOVE: up +val t = baz( + a, + b, + c +) { + val v = "" + + val w = "" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/moveUpDown/expressions/when1.kt b/idea/testData/codeInsight/moveUpDown/expressions/when1.kt new file mode 100644 index 00000000000..f05655dbafd --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/when1.kt @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(x: Boolean) { + // test + when (x) { + false -> { + + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/when1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/when1.kt.after new file mode 100644 index 00000000000..80eaaac0b28 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/when1.kt.after @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + // test + + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/when2.kt b/idea/testData/codeInsight/moveUpDown/expressions/when2.kt new file mode 100644 index 00000000000..f8fef0d66a4 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/when2.kt @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + + } + } + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/when2.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/when2.kt.after new file mode 100644 index 00000000000..bac9bf0cc9d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/when2.kt.after @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + + // test + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt new file mode 100644 index 00000000000..7a7c2610296 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + // test + false -> { + + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt.after new file mode 100644 index 00000000000..80eaaac0b28 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt.after @@ -0,0 +1,16 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + // test + + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt new file mode 100644 index 00000000000..a8ae614ee51 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt @@ -0,0 +1,13 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + // test + } + true -> { + } + else -> { + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt.after new file mode 100644 index 00000000000..8dbe015f785 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt.after @@ -0,0 +1,13 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + } + true -> { + // test + } + else -> { + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt new file mode 100644 index 00000000000..083664a07df --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt @@ -0,0 +1,15 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + // test + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt.after new file mode 100644 index 00000000000..77de8a9f66d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt.after @@ -0,0 +1,15 @@ +// MOVE: down + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + } + } + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt new file mode 100644 index 00000000000..88fe7d65d15 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + + } + // test + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt.after new file mode 100644 index 00000000000..bac9bf0cc9d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt.after @@ -0,0 +1,16 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + + // test + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt new file mode 100644 index 00000000000..8fbc8cdbf7d --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt @@ -0,0 +1,15 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + } + else -> { + // test + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt.after new file mode 100644 index 00000000000..9418f7325a0 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt.after @@ -0,0 +1,15 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + + } + true -> { + + // test + } + else -> { + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt new file mode 100644 index 00000000000..6c285ac6988 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt @@ -0,0 +1,15 @@ +// MOVE: up + +fun foo(x: Boolean) { + when (x) { + false -> { + // test + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt.after new file mode 100644 index 00000000000..a2e1088cb2e --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt.after @@ -0,0 +1,15 @@ +// MOVE: up + +fun foo(x: Boolean) { + // test + when (x) { + false -> { + } + true -> { + + } + else -> { + + } + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/while1.kt b/idea/testData/codeInsight/moveUpDown/expressions/while1.kt new file mode 100644 index 00000000000..5b5801b65b8 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/while1.kt @@ -0,0 +1,8 @@ +// MOVE: down + +fun foo(x: Boolean) { + // test + while (x) { + + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/while1.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/while1.kt.after new file mode 100644 index 00000000000..6a399a964ea --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/while1.kt.after @@ -0,0 +1,8 @@ +// MOVE: down + +fun foo(x: Boolean) { + while (x) { + // test + + } +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/while2.kt b/idea/testData/codeInsight/moveUpDown/expressions/while2.kt new file mode 100644 index 00000000000..1141e224018 --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/while2.kt @@ -0,0 +1,7 @@ +// MOVE: up +fun foo(x: Boolean) { + while (x) { + + } + // test +} diff --git a/idea/testData/codeInsight/moveUpDown/expressions/while2.kt.after b/idea/testData/codeInsight/moveUpDown/expressions/while2.kt.after new file mode 100644 index 00000000000..9c90bd924fe --- /dev/null +++ b/idea/testData/codeInsight/moveUpDown/expressions/while2.kt.after @@ -0,0 +1,7 @@ +// MOVE: up +fun foo(x: Boolean) { + while (x) { + + // test + } +} diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt.2 b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt.2 b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt.2 b/idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt b/idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt.2 b/idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt b/idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt.2 b/idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt.2 b/idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt.2 rename to idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call1.kt b/idea/testData/jetPsiMatcher/expressions/call/_call1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call1.kt rename to idea/testData/jetPsiMatcher/expressions/call/_call1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call1.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/_call1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/_call1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call2.kt b/idea/testData/jetPsiMatcher/expressions/call/_call2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call2.kt rename to idea/testData/jetPsiMatcher/expressions/call/_call2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call2.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/_call2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/_call2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call3.kt b/idea/testData/jetPsiMatcher/expressions/call/_call3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call3.kt rename to idea/testData/jetPsiMatcher/expressions/call/_call3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call3.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/_call3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/_call3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call4.kt b/idea/testData/jetPsiMatcher/expressions/call/_call4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call4.kt rename to idea/testData/jetPsiMatcher/expressions/call/_call4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/_call4.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/_call4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/_call4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/_call4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call1.kt b/idea/testData/jetPsiMatcher/expressions/call/call1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call1.kt rename to idea/testData/jetPsiMatcher/expressions/call/call1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call1.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/call1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/call1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call2.kt b/idea/testData/jetPsiMatcher/expressions/call/call2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call2.kt rename to idea/testData/jetPsiMatcher/expressions/call/call2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call2.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/call2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/call2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call3.kt b/idea/testData/jetPsiMatcher/expressions/call/call3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call3.kt rename to idea/testData/jetPsiMatcher/expressions/call/call3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call3.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/call3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/call3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call4.kt b/idea/testData/jetPsiMatcher/expressions/call/call4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call4.kt rename to idea/testData/jetPsiMatcher/expressions/call/call4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/call/call4.kt.2 b/idea/testData/jetPsiMatcher/expressions/call/call4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/call/call4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/call/call4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/const/_const.kt b/idea/testData/jetPsiMatcher/expressions/const/_const.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/const/_const.kt rename to idea/testData/jetPsiMatcher/expressions/const/_const.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/const/_const.kt.2 b/idea/testData/jetPsiMatcher/expressions/const/_const.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/const/_const.kt.2 rename to idea/testData/jetPsiMatcher/expressions/const/_const.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/const/const.kt b/idea/testData/jetPsiMatcher/expressions/const/const.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/const/const.kt rename to idea/testData/jetPsiMatcher/expressions/const/const.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/const/const.kt.2 b/idea/testData/jetPsiMatcher/expressions/const/const.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/const/const.kt.2 rename to idea/testData/jetPsiMatcher/expressions/const/const.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc1.kt b/idea/testData/jetPsiMatcher/expressions/misc/_misc1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc1.kt rename to idea/testData/jetPsiMatcher/expressions/misc/_misc1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc1.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/_misc1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/_misc1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc2.kt b/idea/testData/jetPsiMatcher/expressions/misc/_misc2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc2.kt rename to idea/testData/jetPsiMatcher/expressions/misc/_misc2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc2.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/_misc2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/_misc2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc3.kt b/idea/testData/jetPsiMatcher/expressions/misc/_misc3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc3.kt rename to idea/testData/jetPsiMatcher/expressions/misc/_misc3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc3.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/_misc3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/_misc3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc1.kt b/idea/testData/jetPsiMatcher/expressions/misc/misc1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc1.kt rename to idea/testData/jetPsiMatcher/expressions/misc/misc1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc1.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/misc1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/misc1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc2.kt b/idea/testData/jetPsiMatcher/expressions/misc/misc2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc2.kt rename to idea/testData/jetPsiMatcher/expressions/misc/misc2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc2.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/misc2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/misc2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc3.kt b/idea/testData/jetPsiMatcher/expressions/misc/misc3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc3.kt rename to idea/testData/jetPsiMatcher/expressions/misc/misc3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/misc/misc3.kt.2 b/idea/testData/jetPsiMatcher/expressions/misc/misc3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/misc/misc3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/misc/misc3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/simpleName/_simpleName.kt b/idea/testData/jetPsiMatcher/expressions/simpleName/_simpleName.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/simpleName/_simpleName.kt rename to idea/testData/jetPsiMatcher/expressions/simpleName/_simpleName.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/simpleName/_simpleName.kt.2 b/idea/testData/jetPsiMatcher/expressions/simpleName/_simpleName.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/simpleName/_simpleName.kt.2 rename to idea/testData/jetPsiMatcher/expressions/simpleName/_simpleName.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/simpleName/simpleName.kt b/idea/testData/jetPsiMatcher/expressions/simpleName/simpleName.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/simpleName/simpleName.kt rename to idea/testData/jetPsiMatcher/expressions/simpleName/simpleName.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/simpleName/simpleName.kt.2 b/idea/testData/jetPsiMatcher/expressions/simpleName/simpleName.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/simpleName/simpleName.kt.2 rename to idea/testData/jetPsiMatcher/expressions/simpleName/simpleName.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super1.kt b/idea/testData/jetPsiMatcher/expressions/super/_super1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super1.kt rename to idea/testData/jetPsiMatcher/expressions/super/_super1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super1.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/_super1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/_super1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super2.kt b/idea/testData/jetPsiMatcher/expressions/super/_super2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super2.kt rename to idea/testData/jetPsiMatcher/expressions/super/_super2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super2.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/_super2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/_super2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super3.kt b/idea/testData/jetPsiMatcher/expressions/super/_super3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super3.kt rename to idea/testData/jetPsiMatcher/expressions/super/_super3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super3.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/_super3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/_super3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super4.kt b/idea/testData/jetPsiMatcher/expressions/super/_super4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super4.kt rename to idea/testData/jetPsiMatcher/expressions/super/_super4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/_super4.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/_super4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/_super4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/_super4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super1.kt b/idea/testData/jetPsiMatcher/expressions/super/super1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super1.kt rename to idea/testData/jetPsiMatcher/expressions/super/super1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super1.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/super1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/super1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super2.kt b/idea/testData/jetPsiMatcher/expressions/super/super2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super2.kt rename to idea/testData/jetPsiMatcher/expressions/super/super2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super2.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/super2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/super2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super3.kt b/idea/testData/jetPsiMatcher/expressions/super/super3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super3.kt rename to idea/testData/jetPsiMatcher/expressions/super/super3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super3.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/super3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/super3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super4.kt b/idea/testData/jetPsiMatcher/expressions/super/super4.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super4.kt rename to idea/testData/jetPsiMatcher/expressions/super/super4.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/super/super4.kt.2 b/idea/testData/jetPsiMatcher/expressions/super/super4.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/super/super4.kt.2 rename to idea/testData/jetPsiMatcher/expressions/super/super4.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/throw/_throw.kt b/idea/testData/jetPsiMatcher/expressions/throw/_throw.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/throw/_throw.kt rename to idea/testData/jetPsiMatcher/expressions/throw/_throw.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/throw/_throw.kt.2 b/idea/testData/jetPsiMatcher/expressions/throw/_throw.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/throw/_throw.kt.2 rename to idea/testData/jetPsiMatcher/expressions/throw/_throw.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/throw/throw.kt b/idea/testData/jetPsiMatcher/expressions/throw/throw.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/throw/throw.kt rename to idea/testData/jetPsiMatcher/expressions/throw/throw.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/throw/throw.kt.2 b/idea/testData/jetPsiMatcher/expressions/throw/throw.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/throw/throw.kt.2 rename to idea/testData/jetPsiMatcher/expressions/throw/throw.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt.2 b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt.2 b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt.2 b/idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt.2 rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt b/idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt.2 b/idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt.2 rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt.2 diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt b/idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt diff --git a/compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt.2 b/idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt.2 similarity index 100% rename from compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt.2 rename to idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt.2 diff --git a/idea/testData/jetPsiMatcher/types/_functional1.kt b/idea/testData/jetPsiMatcher/types/_functional1.kt new file mode 100644 index 00000000000..f33284d37f3 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_functional1.kt @@ -0,0 +1,2 @@ +// NOT_EQUAL +val x: (s: String, b: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_functional1.kt.2 b/idea/testData/jetPsiMatcher/types/_functional1.kt.2 new file mode 100644 index 00000000000..38402488d77 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_functional1.kt.2 @@ -0,0 +1 @@ +val x: (s: Boolean, b: String) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_functional2.kt b/idea/testData/jetPsiMatcher/types/_functional2.kt new file mode 100644 index 00000000000..10576c8c432 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_functional2.kt @@ -0,0 +1,2 @@ +// NOT_EQUAL +val x: String.(b: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_functional2.kt.2 b/idea/testData/jetPsiMatcher/types/_functional2.kt.2 new file mode 100644 index 00000000000..310f441f850 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_functional2.kt.2 @@ -0,0 +1 @@ +val x: (s: String, b: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_nullable1.kt b/idea/testData/jetPsiMatcher/types/_nullable1.kt new file mode 100644 index 00000000000..acb4730cc08 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_nullable1.kt @@ -0,0 +1,2 @@ +// NOT_EQUAL +val x: String \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_nullable1.kt.2 b/idea/testData/jetPsiMatcher/types/_nullable1.kt.2 new file mode 100644 index 00000000000..b43528c36f1 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_nullable1.kt.2 @@ -0,0 +1 @@ +val x: String? \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_user1.kt b/idea/testData/jetPsiMatcher/types/_user1.kt new file mode 100644 index 00000000000..d85c1b188ac --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_user1.kt @@ -0,0 +1,2 @@ +// NOT_EQUAL +val x: Map> \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_user1.kt.2 b/idea/testData/jetPsiMatcher/types/_user1.kt.2 new file mode 100644 index 00000000000..eea5c86cdd2 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_user1.kt.2 @@ -0,0 +1 @@ +val y: Map> \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_user2.kt b/idea/testData/jetPsiMatcher/types/_user2.kt new file mode 100644 index 00000000000..797debd3543 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_user2.kt @@ -0,0 +1,2 @@ +// NOT_EQUAL +val x: Collection \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/_user2.kt.2 b/idea/testData/jetPsiMatcher/types/_user2.kt.2 new file mode 100644 index 00000000000..6c8662b0250 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/_user2.kt.2 @@ -0,0 +1 @@ +val x: MutableCollection \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional1.kt b/idea/testData/jetPsiMatcher/types/functional1.kt new file mode 100644 index 00000000000..40071fe2b1c --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional1.kt @@ -0,0 +1 @@ +val x: String -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional1.kt.2 b/idea/testData/jetPsiMatcher/types/functional1.kt.2 new file mode 100644 index 00000000000..799a25379cf --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional1.kt.2 @@ -0,0 +1 @@ +val y: String -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional2.kt b/idea/testData/jetPsiMatcher/types/functional2.kt new file mode 100644 index 00000000000..310f441f850 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional2.kt @@ -0,0 +1 @@ +val x: (s: String, b: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional2.kt.2 b/idea/testData/jetPsiMatcher/types/functional2.kt.2 new file mode 100644 index 00000000000..004a1d24a98 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional2.kt.2 @@ -0,0 +1 @@ +val x: (x: String, y: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional3.kt b/idea/testData/jetPsiMatcher/types/functional3.kt new file mode 100644 index 00000000000..aac457e03f0 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional3.kt @@ -0,0 +1 @@ +val x: String.(b: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/functional3.kt.2 b/idea/testData/jetPsiMatcher/types/functional3.kt.2 new file mode 100644 index 00000000000..202b79b1e59 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/functional3.kt.2 @@ -0,0 +1 @@ +val x: String.(n: Boolean) -> Int \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/nullable1.kt b/idea/testData/jetPsiMatcher/types/nullable1.kt new file mode 100644 index 00000000000..b43528c36f1 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/nullable1.kt @@ -0,0 +1 @@ +val x: String? \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/nullable1.kt.2 b/idea/testData/jetPsiMatcher/types/nullable1.kt.2 new file mode 100644 index 00000000000..bb095c9d12d --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/nullable1.kt.2 @@ -0,0 +1 @@ +val y: String? \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/user1.kt b/idea/testData/jetPsiMatcher/types/user1.kt new file mode 100644 index 00000000000..b15fdf0cf95 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/user1.kt @@ -0,0 +1 @@ +val x: Collection \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/user1.kt.2 b/idea/testData/jetPsiMatcher/types/user1.kt.2 new file mode 100644 index 00000000000..809fba40a0e --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/user1.kt.2 @@ -0,0 +1 @@ +val y: Collection \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/user2.kt b/idea/testData/jetPsiMatcher/types/user2.kt new file mode 100644 index 00000000000..3715d26a30f --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/user2.kt @@ -0,0 +1 @@ +val x: Map> \ No newline at end of file diff --git a/idea/testData/jetPsiMatcher/types/user2.kt.2 b/idea/testData/jetPsiMatcher/types/user2.kt.2 new file mode 100644 index 00000000000..95a905d3a30 --- /dev/null +++ b/idea/testData/jetPsiMatcher/types/user2.kt.2 @@ -0,0 +1 @@ +val y: Map> \ 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..c4dd225c1cb --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/AbstractCodeMoverTest.java @@ -0,0 +1,104 @@ +/* + * 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.application.ApplicationManager; +import com.intellij.openapi.editor.actionSystem.EditorAction; +import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.testFramework.LightCodeInsightTestCase; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.InTextDirectivesUtils; +import org.jetbrains.jet.plugin.codeInsight.upDownMover.JetDeclarationMover; +import org.jetbrains.jet.plugin.codeInsight.upDownMover.JetExpressionMover; + +import java.io.File; + +public abstract class AbstractCodeMoverTest extends LightCodeInsightTestCase { + public void doTestClassBodyDeclaration(@NotNull String path) throws Exception { + doTest(path, JetDeclarationMover.class); + } + + public void doTestExpression(@NotNull String path) throws Exception { + doTest(path, JetExpressionMover.class); + } + + private void doTest(@NotNull String path, @NotNull Class defaultMoverClass) 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; + } + } + + String moverClassName = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// MOVER_CLASS: "); + if (moverClassName == null) { + moverClassName = defaultMoverClass.getName(); + } + + assertTrue("No mover found", actualMover != null); + assertEquals("Unmatched movers", moverClassName, actualMover.getClass().getName()); + assertEquals("Invalid applicability", isApplicableExpected, info.toMove2 != null); + + if (isApplicableExpected) { + invokeAndCheck(path, down); + } + } + + private void invokeAndCheck(@NotNull String path, final boolean down) { + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + 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..244b9db74ff --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/moveUpDown/CodeMoverTestGenerated.java @@ -0,0 +1,864 @@ +/* + * 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, CodeMoverTestGenerated.ClosingBraces.class, CodeMoverTestGenerated.Expressions.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.FunctionAnchors.class, ClassBodyDeclarations.Property.class, ClassBodyDeclarations.PropertyAnchors.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/functionAnchors") + public static class FunctionAnchors extends AbstractCodeMoverTest { + public void testAllFilesPresentInFunctionAnchors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("keyword.kt") + public void testKeyword() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/keyword.kt"); + } + + @TestMetadata("name.kt") + public void testName() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/name.kt"); + } + + @TestMetadata("returnType.kt") + public void testReturnType() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/returnType.kt"); + } + + @TestMetadata("typeParams1.kt") + public void testTypeParams1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams1.kt"); + } + + @TestMetadata("typeParams2.kt") + public void testTypeParams2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams2.kt"); + } + + @TestMetadata("typeParams3.kt") + public void testTypeParams3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/typeParams3.kt"); + } + + @TestMetadata("valueArgs1.kt") + public void testValueArgs1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs1.kt"); + } + + @TestMetadata("valueArgs2.kt") + public void testValueArgs2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs2.kt"); + } + + @TestMetadata("valueArgs3.kt") + public void testValueArgs3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs3.kt"); + } + + @TestMetadata("valueArgs4.kt") + public void testValueArgs4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs4.kt"); + } + + @TestMetadata("valueArgs5.kt") + public void testValueArgs5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs5.kt"); + } + + @TestMetadata("valueArgs6.kt") + public void testValueArgs6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueArgs6.kt"); + } + + @TestMetadata("valueParams1.kt") + public void testValueParams1() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams1.kt"); + } + + @TestMetadata("valueParams2.kt") + public void testValueParams2() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams2.kt"); + } + + @TestMetadata("valueParams3.kt") + public void testValueParams3() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams3.kt"); + } + + @TestMetadata("valueParams4.kt") + public void testValueParams4() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams4.kt"); + } + + @TestMetadata("valueParams5.kt") + public void testValueParams5() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams5.kt"); + } + + @TestMetadata("valueParams6.kt") + public void testValueParams6() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/functionAnchors/valueParams6.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"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors") + public static class PropertyAnchors extends AbstractCodeMoverTest { + public void testAllFilesPresentInPropertyAnchors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("keyword.kt") + public void testKeyword() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/keyword.kt"); + } + + @TestMetadata("name.kt") + public void testName() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/name.kt"); + } + + @TestMetadata("returnType.kt") + public void testReturnType() throws Exception { + doTestClassBodyDeclaration("idea/testData/codeInsight/moveUpDown/classBodyDeclarations/propertyAnchors/returnType.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(FunctionAnchors.class); + suite.addTestSuite(Property.class); + suite.addTestSuite(PropertyAnchors.class); + return suite; + } + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces") + @InnerTestClasses({ClosingBraces.For.class, ClosingBraces.Function.class, ClosingBraces.If.class, ClosingBraces.Nested.class, ClosingBraces.When.class, ClosingBraces.While.class}) + public static class ClosingBraces extends AbstractCodeMoverTest { + public void testAllFilesPresentInClosingBraces() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/for") + public static class For extends AbstractCodeMoverTest { + public void testAllFilesPresentInFor() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces/for"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("for1.kt") + public void testFor1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/for/for1.kt"); + } + + @TestMetadata("for2.kt") + public void testFor2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/for/for2.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/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/closingBraces/function"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("function1.kt") + public void testFunction1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/function/function1.kt"); + } + + @TestMetadata("function2.kt") + public void testFunction2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/function/function2.kt"); + } + + @TestMetadata("function3.kt") + public void testFunction3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/function/function3.kt"); + } + + @TestMetadata("function4.kt") + public void testFunction4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/function/function4.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/if") + public static class If extends AbstractCodeMoverTest { + public void testAllFilesPresentInIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces/if"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("if1.kt") + public void testIf1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/if/if1.kt"); + } + + @TestMetadata("if2.kt") + public void testIf2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/if/if2.kt"); + } + + @TestMetadata("if3.kt") + public void testIf3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/if/if3.kt"); + } + + @TestMetadata("if4.kt") + public void testIf4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/if/if4.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/nested") + public static class Nested extends AbstractCodeMoverTest { + public void testAllFilesPresentInNested() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces/nested"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("nested1.kt") + public void testNested1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested1.kt"); + } + + @TestMetadata("nested2.kt") + public void testNested2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/nested/nested2.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/when") + public static class When extends AbstractCodeMoverTest { + public void testAllFilesPresentInWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces/when"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("when1.kt") + public void testWhen1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/when1.kt"); + } + + @TestMetadata("when2.kt") + public void testWhen2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/when2.kt"); + } + + @TestMetadata("whenEntry1.kt") + public void testWhenEntry1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry1.kt"); + } + + @TestMetadata("whenEntry2.kt") + public void testWhenEntry2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry2.kt"); + } + + @TestMetadata("whenEntry3.kt") + public void testWhenEntry3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry3.kt"); + } + + @TestMetadata("whenEntry4.kt") + public void testWhenEntry4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/when/whenEntry4.kt"); + } + + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/closingBraces/while") + public static class While extends AbstractCodeMoverTest { + public void testAllFilesPresentInWhile() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/closingBraces/while"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("while1.kt") + public void testWhile1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/while/while1.kt"); + } + + @TestMetadata("while2.kt") + public void testWhile2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/while/while2.kt"); + } + + @TestMetadata("while3.kt") + public void testWhile3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/while/while3.kt"); + } + + @TestMetadata("while4.kt") + public void testWhile4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/closingBraces/while/while4.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("ClosingBraces"); + suite.addTestSuite(ClosingBraces.class); + suite.addTestSuite(For.class); + suite.addTestSuite(Function.class); + suite.addTestSuite(If.class); + suite.addTestSuite(Nested.class); + suite.addTestSuite(When.class); + suite.addTestSuite(While.class); + return suite; + } + } + + @TestMetadata("idea/testData/codeInsight/moveUpDown/expressions") + public static class Expressions extends AbstractCodeMoverTest { + public void testAllFilesPresentInExpressions() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/moveUpDown/expressions"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("declaration1.kt") + public void testDeclaration1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/declaration1.kt"); + } + + @TestMetadata("declaration2.kt") + public void testDeclaration2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/declaration2.kt"); + } + + @TestMetadata("If1.kt") + public void testIf1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/If1.kt"); + } + + @TestMetadata("if2.kt") + public void testIf2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/if2.kt"); + } + + @TestMetadata("if3.kt") + public void testIf3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/if3.kt"); + } + + @TestMetadata("if4.kt") + public void testIf4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/if4.kt"); + } + + @TestMetadata("lambda1.kt") + public void testLambda1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/lambda1.kt"); + } + + @TestMetadata("lambda2.kt") + public void testLambda2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/lambda2.kt"); + } + + @TestMetadata("lambda3.kt") + public void testLambda3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/lambda3.kt"); + } + + @TestMetadata("when1.kt") + public void testWhen1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/when1.kt"); + } + + @TestMetadata("when2.kt") + public void testWhen2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/when2.kt"); + } + + @TestMetadata("whenEntry1.kt") + public void testWhenEntry1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry1.kt"); + } + + @TestMetadata("whenEntry2.kt") + public void testWhenEntry2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry2.kt"); + } + + @TestMetadata("whenEntry3.kt") + public void testWhenEntry3() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry3.kt"); + } + + @TestMetadata("whenEntry4.kt") + public void testWhenEntry4() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry4.kt"); + } + + @TestMetadata("whenEntry5.kt") + public void testWhenEntry5() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry5.kt"); + } + + @TestMetadata("whenEntry6.kt") + public void testWhenEntry6() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/whenEntry6.kt"); + } + + @TestMetadata("while1.kt") + public void testWhile1() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/while1.kt"); + } + + @TestMetadata("while2.kt") + public void testWhile2() throws Exception { + doTestExpression("idea/testData/codeInsight/moveUpDown/expressions/while2.kt"); + } + + } + + public static Test suite() { + TestSuite suite = new TestSuite("CodeMoverTestGenerated"); + suite.addTest(ClassBodyDeclarations.innerSuite()); + suite.addTest(ClosingBraces.innerSuite()); + suite.addTestSuite(Expressions.class); + return suite; + } +} diff --git a/compiler/tests/org/jetbrains/jet/lang/psi/AbstractJetPsiMatcherTest.java b/idea/tests/org/jetbrains/jet/psi/AbstractJetPsiMatcherTest.java similarity index 64% rename from compiler/tests/org/jetbrains/jet/lang/psi/AbstractJetPsiMatcherTest.java rename to idea/tests/org/jetbrains/jet/psi/AbstractJetPsiMatcherTest.java index 68f543b7342..cf35da9fa89 100644 --- a/compiler/tests/org/jetbrains/jet/lang/psi/AbstractJetPsiMatcherTest.java +++ b/idea/tests/org/jetbrains/jet/psi/AbstractJetPsiMatcherTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.jet.lang.psi; +package org.jetbrains.jet.psi; import com.intellij.openapi.util.io.FileUtil; import org.jetbrains.annotations.NotNull; @@ -22,6 +22,10 @@ import org.jetbrains.jet.InTextDirectivesUtils; import org.jetbrains.jet.JetLiteFixture; import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment; import org.jetbrains.jet.config.CompilerConfiguration; +import org.jetbrains.jet.lang.psi.JetExpression; +import org.jetbrains.jet.lang.psi.JetPsiFactory; +import org.jetbrains.jet.lang.psi.JetTypeReference; +import org.jetbrains.jet.plugin.util.JetPsiMatcher; import java.io.File; @@ -41,6 +45,24 @@ public abstract class AbstractJetPsiMatcherTest extends JetLiteFixture { ); } + public void doTestTypes(@NotNull String path) throws Exception { + String fileText = FileUtil.loadFile(new File(path)); + String fileText2 = FileUtil.loadFile(new File(path + ".2")); + + boolean equalityExpected = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// NOT_EQUAL") == null; + + JetTypeReference typeRef = JetPsiFactory.createProperty(getProject(), fileText).getTypeRef(); + JetTypeReference typeRef2 = JetPsiFactory.createProperty(getProject(), fileText2).getTypeRef(); + + assertNotNull(typeRef); + assertNotNull(typeRef2); + + assertTrue( + "JetPsiMatcher.checkElementMatch() should return " + equalityExpected, + equalityExpected == JetPsiMatcher.checkElementMatch(typeRef, typeRef2) + ); + } + @Override protected JetCoreEnvironment createEnvironment() { return new JetCoreEnvironment(getTestRootDisposable(), new CompilerConfiguration()); diff --git a/compiler/tests/org/jetbrains/jet/lang/psi/JetPsiMatcherTest.java b/idea/tests/org/jetbrains/jet/psi/JetPsiMatcherTest.java similarity index 55% rename from compiler/tests/org/jetbrains/jet/lang/psi/JetPsiMatcherTest.java rename to idea/tests/org/jetbrains/jet/psi/JetPsiMatcherTest.java index 726cc5153ed..c365371af18 100644 --- a/compiler/tests/org/jetbrains/jet/lang/psi/JetPsiMatcherTest.java +++ b/idea/tests/org/jetbrains/jet/psi/JetPsiMatcherTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.jet.lang.psi; +package org.jetbrains.jet.psi; import junit.framework.Assert; import junit.framework.Test; @@ -26,337 +26,332 @@ import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.test.InnerTestClasses; import org.jetbrains.jet.test.TestMetadata; -import org.jetbrains.jet.lang.psi.AbstractJetPsiMatcherTest; +import org.jetbrains.jet.psi.AbstractJetPsiMatcherTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("compiler/testData/psi/jetPsiMatcher") -@InnerTestClasses({JetPsiMatcherTest.Expressions.class}) +@InnerTestClasses({JetPsiMatcherTest.Expressions.class, JetPsiMatcherTest.Types.class}) public class JetPsiMatcherTest extends AbstractJetPsiMatcherTest { - public void testAllFilesPresentInJetPsiMatcher() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions") + @TestMetadata("idea/testData/jetPsiMatcher/expressions") @InnerTestClasses({Expressions.ArrayAccess.class, Expressions.BinaryExpr.class, Expressions.Call.class, Expressions.Const.class, Expressions.Misc.class, Expressions.SimpleName.class, Expressions.Super.class, Expressions.Throw.class, Expressions.UnaryExpr.class}) public static class Expressions extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInExpressions() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/arrayAccess") public static class ArrayAccess extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInArrayAccess() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/arrayAccess"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("arrayAccess1.kt") public void testArrayAccess1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess1.kt"); } @TestMetadata("arrayAccess2.kt") public void testArrayAccess2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/arrayAccess/arrayAccess2.kt"); } @TestMetadata("_arrayAccess1.kt") public void test_arrayAccess1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess1.kt"); } @TestMetadata("_arrayAccess2.kt") public void test_arrayAccess2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess2.kt"); } @TestMetadata("_arrayAccess3.kt") public void test_arrayAccess3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/arrayAccess/_arrayAccess3.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/binaryExpr") public static class BinaryExpr extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInBinaryExpr() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/binaryExpr"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("binaryExpr1.kt") public void testBinaryExpr1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr1.kt"); } @TestMetadata("binaryExpr2.kt") public void testBinaryExpr2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr2.kt"); } @TestMetadata("binaryExpr3.kt") public void testBinaryExpr3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr3.kt"); } @TestMetadata("binaryExpr4.kt") public void testBinaryExpr4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr4.kt"); } @TestMetadata("binaryExpr5.kt") public void testBinaryExpr5() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/binaryExpr5.kt"); } @TestMetadata("_binaryExpr1.kt") public void test_binaryExpr1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr1.kt"); } @TestMetadata("_binaryExpr2.kt") public void test_binaryExpr2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr2.kt"); } @TestMetadata("_binaryExpr3.kt") public void test_binaryExpr3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr3.kt"); } @TestMetadata("_binaryExpr4.kt") public void test_binaryExpr4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr4.kt"); } @TestMetadata("_binaryExpr5.kt") public void test_binaryExpr5() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr5.kt"); } @TestMetadata("_binaryExpr6.kt") public void test_binaryExpr6() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/binaryExpr/_binaryExpr6.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/call") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/call") public static class Call extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInCall() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/call"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/call"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("call1.kt") public void testCall1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/call1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/call1.kt"); } @TestMetadata("call2.kt") public void testCall2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/call2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/call2.kt"); } @TestMetadata("call3.kt") public void testCall3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/call3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/call3.kt"); } @TestMetadata("call4.kt") public void testCall4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/call4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/call4.kt"); } @TestMetadata("_call1.kt") public void test_call1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/_call1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/_call1.kt"); } @TestMetadata("_call2.kt") public void test_call2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/_call2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/_call2.kt"); } @TestMetadata("_call3.kt") public void test_call3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/_call3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/_call3.kt"); } @TestMetadata("_call4.kt") public void test_call4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/call/_call4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/call/_call4.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/const") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/const") public static class Const extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInConst() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/const"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/const"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("const.kt") public void testConst() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/const/const.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/const/const.kt"); } @TestMetadata("_const.kt") public void test_const() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/const/_const.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/const/_const.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/misc") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/misc") public static class Misc extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInMisc() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/misc"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/misc"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("misc1.kt") public void testMisc1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/misc1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/misc1.kt"); } @TestMetadata("misc2.kt") public void testMisc2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/misc2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/misc2.kt"); } @TestMetadata("misc3.kt") public void testMisc3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/misc3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/misc3.kt"); } @TestMetadata("_misc1.kt") public void test_misc1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/_misc1.kt"); } @TestMetadata("_misc2.kt") public void test_misc2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/_misc2.kt"); } @TestMetadata("_misc3.kt") public void test_misc3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/misc/_misc3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/misc/_misc3.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/simpleName") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/simpleName") public static class SimpleName extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInSimpleName() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/simpleName"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/simpleName"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("simpleName.kt") public void testSimpleName() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/simpleName/simpleName.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/simpleName/simpleName.kt"); } @TestMetadata("_simpleName.kt") public void test_simpleName() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/simpleName/_simpleName.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/simpleName/_simpleName.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/super") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/super") public static class Super extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInSuper() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/super"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/super"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("super1.kt") public void testSuper1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/super1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/super1.kt"); } @TestMetadata("super2.kt") public void testSuper2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/super2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/super2.kt"); } @TestMetadata("super3.kt") public void testSuper3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/super3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/super3.kt"); } @TestMetadata("super4.kt") public void testSuper4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/super4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/super4.kt"); } @TestMetadata("_super1.kt") public void test_super1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/_super1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/_super1.kt"); } @TestMetadata("_super2.kt") public void test_super2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/_super2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/_super2.kt"); } @TestMetadata("_super3.kt") public void test_super3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/_super3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/_super3.kt"); } @TestMetadata("_super4.kt") public void test_super4() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/super/_super4.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/super/_super4.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/throw") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/throw") public static class Throw extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInThrow() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/throw"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/throw"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("throw.kt") public void testThrow() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/throw/throw.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/throw/throw.kt"); } @TestMetadata("_throw.kt") public void test_throw() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/throw/_throw.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/throw/_throw.kt"); } } - @TestMetadata("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr") + @TestMetadata("idea/testData/jetPsiMatcher/expressions/unaryExpr") public static class UnaryExpr extends AbstractJetPsiMatcherTest { public void testAllFilesPresentInUnaryExpr() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/expressions/unaryExpr"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("unaryExpr1.kt") public void testUnaryExpr1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr1.kt"); } @TestMetadata("unaryExpr2.kt") public void testUnaryExpr2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/unaryExpr/unaryExpr2.kt"); } @TestMetadata("_unaryExpr1.kt") public void test_unaryExpr1() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr1.kt"); } @TestMetadata("_unaryExpr2.kt") public void test_unaryExpr2() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr2.kt"); } @TestMetadata("_unaryExpr3.kt") public void test_unaryExpr3() throws Exception { - doTestExpressions("compiler/testData/psi/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt"); + doTestExpressions("idea/testData/jetPsiMatcher/expressions/unaryExpr/_unaryExpr3.kt"); } } @@ -377,10 +372,73 @@ public class JetPsiMatcherTest extends AbstractJetPsiMatcherTest { } } + @TestMetadata("idea/testData/jetPsiMatcher/types") + public static class Types extends AbstractJetPsiMatcherTest { + public void testAllFilesPresentInTypes() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/jetPsiMatcher/types"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("functional1.kt") + public void testFunctional1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/functional1.kt"); + } + + @TestMetadata("functional2.kt") + public void testFunctional2() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/functional2.kt"); + } + + @TestMetadata("functional3.kt") + public void testFunctional3() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/functional3.kt"); + } + + @TestMetadata("nullable1.kt") + public void testNullable1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/nullable1.kt"); + } + + @TestMetadata("user1.kt") + public void testUser1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/user1.kt"); + } + + @TestMetadata("user2.kt") + public void testUser2() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/user2.kt"); + } + + @TestMetadata("_functional1.kt") + public void test_functional1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/_functional1.kt"); + } + + @TestMetadata("_functional2.kt") + public void test_functional2() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/_functional2.kt"); + } + + @TestMetadata("_nullable1.kt") + public void test_nullable1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/_nullable1.kt"); + } + + @TestMetadata("_user1.kt") + public void test_user1() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/_user1.kt"); + } + + @TestMetadata("_user2.kt") + public void test_user2() throws Exception { + doTestTypes("idea/testData/jetPsiMatcher/types/_user2.kt"); + } + + } + public static Test suite() { TestSuite suite = new TestSuite("JetPsiMatcherTest"); - suite.addTestSuite(JetPsiMatcherTest.class); suite.addTest(Expressions.innerSuite()); + suite.addTestSuite(Types.class); return suite; } }