Implement "move class-level declaration up/down" action handler

This commit is contained in:
Alexey Sedunov
2013-05-29 13:11:46 +04:00
parent 3a2e30152a
commit fe8891299b
136 changed files with 1900 additions and 0 deletions
@@ -17,7 +17,10 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lexer.JetTokens;
public class JetClassInitializer extends JetDeclarationImpl implements JetStatementExpression {
public JetClassInitializer(@NotNull ASTNode node) {
@@ -40,4 +43,11 @@ public class JetClassInitializer extends JetDeclarationImpl implements JetStatem
assert body != null;
return body;
}
@NotNull
public PsiElement getOpenBraceNode() {
ASTNode openBraceNode = getNode().findChildByType(JetTokens.LBRACE);
assert openBraceNode != null;
return openBraceNode.getPsi();
}
}
@@ -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;
}
}
@@ -32,6 +32,7 @@ import org.jetbrains.jet.completion.AbstractJavaWithLibCompletionTest;
import org.jetbrains.jet.completion.AbstractJetJSCompletionTest;
import org.jetbrains.jet.completion.AbstractKeywordCompletionTest;
import org.jetbrains.jet.jvm.compiler.*;
import org.jetbrains.jet.plugin.codeInsight.moveUpDown.AbstractCodeMoverTest;
import org.jetbrains.jet.psi.AbstractJetPsiMatcherTest;
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest;
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest;
@@ -338,6 +339,13 @@ public class GenerateTests {
testModelWithDirectories("idea/testData/hierarchy/class/super", "doSuperClassHierarchyTest"),
testModelWithDirectories("idea/testData/hierarchy/class/sub", "doSubClassHierarchyTest")
);
generateTest(
"idea/tests/",
"CodeMoverTestGenerated",
AbstractCodeMoverTest.class,
testModel("idea/testData/codeInsight/moveUpDown/classBodyDeclarations", "doTestClassBodyDeclaration")
);
}
private static SimpleTestClassModel testModel(@NotNull String rootPath) {
+4
View File
@@ -283,6 +283,10 @@
serviceImplementation="org.jetbrains.jet.plugin.editor.JetEditorOptions"/>
<editorAppearanceConfigurable instance="org.jetbrains.jet.plugin.editor.JetSettingEditorConfigurable"/>
<statementUpDownMover id="jetDeclaration"
implementation="org.jetbrains.jet.plugin.codeInsight.upDownMover.JetDeclarationMover"
order="before jetExpression" />
<intentionAction>
<className>org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction</className>
<category>Kotlin</category>
@@ -0,0 +1,63 @@
package org.jetbrains.jet.plugin.codeInsight.upDownMover;
import com.intellij.codeInsight.editorActions.moveUpDown.LineMover;
import com.intellij.codeInsight.editorActions.moveUpDown.LineRange;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiWhiteSpace;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetFile;
public abstract class AbstractJetUpDownMover extends LineMover {
protected AbstractJetUpDownMover() {
}
protected static PsiElement adjustWhiteSpaceSibling(
@NotNull Editor editor,
@NotNull LineRange sourceRange,
@NotNull MoveInfo info,
boolean down
) {
PsiElement sibling = down ? sourceRange.lastElement.getNextSibling() : sourceRange.firstElement.getPrevSibling();
if (sibling instanceof PsiWhiteSpace) {
Document doc = editor.getDocument();
TextRange spaceRange = sibling.getTextRange();
int startLine = doc.getLineNumber(spaceRange.getStartOffset());
int endLine = doc.getLineNumber(spaceRange.getEndOffset());
if (endLine - startLine > 1) {
int nearLine = down ? sourceRange.endLine : sourceRange.startLine - 1;
info.toMove = sourceRange;
info.toMove2 = new LineRange(nearLine, nearLine + 1);
return null;
}
sibling = firstNonWhiteElement(sibling, down);
}
if (sibling == null) {
info.toMove2 = null;
return null;
}
return sibling;
}
@Nullable
protected static PsiElement firstNonWhiteSibling(@NotNull LineRange lineRange, boolean down) {
return firstNonWhiteElement(down ? lineRange.lastElement.getNextSibling() : lineRange.firstElement.getPrevSibling(), down);
}
@Override
public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) {
return (file instanceof JetFile) && super.checkAvailable(editor, file, info, down);
}
}
@@ -0,0 +1,263 @@
package org.jetbrains.jet.plugin.codeInsight.upDownMover;
import com.intellij.codeInsight.editorActions.moveUpDown.LineRange;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.*;
import org.jetbrains.jet.lexer.JetTokens;
import java.util.ArrayList;
import java.util.List;
public class JetDeclarationMover extends AbstractJetUpDownMover {
public JetDeclarationMover() {
}
@NotNull
private static List<PsiElement> getDeclarationAnchors(@NotNull JetDeclaration declaration) {
final List<PsiElement> memberSuspects = new ArrayList<PsiElement>();
JetModifierList modifierList = declaration.getModifierList();
if (modifierList != null) memberSuspects.add(modifierList);
if (declaration instanceof JetNamedDeclaration) {
PsiElement nameIdentifier = ((JetNamedDeclaration) declaration).getNameIdentifier();
if (nameIdentifier != null) memberSuspects.add(nameIdentifier);
}
declaration.accept(
new JetVisitorVoid() {
@Override
public void visitAnonymousInitializer(JetClassInitializer initializer) {
memberSuspects.add(initializer.getOpenBraceNode());
}
@Override
public void visitClassObject(JetClassObject classObject) {
PsiElement classKeyword = classObject.getClassKeywordNode();
if (classKeyword != null) memberSuspects.add(classKeyword);
}
@Override
public void visitNamedFunction(JetNamedFunction function) {
PsiElement equalsToken = function.getEqualsToken();
if (equalsToken != null) memberSuspects.add(equalsToken);
JetParameterList parameterList = function.getValueParameterList();
if (parameterList != null) memberSuspects.add(parameterList);
JetTypeParameterList typeParameterList = function.getTypeParameterList();
if (typeParameterList != null) memberSuspects.add(typeParameterList);
JetTypeReference receiverTypeRef = function.getReceiverTypeRef();
if (receiverTypeRef != null) memberSuspects.add(receiverTypeRef);
JetTypeReference returnTypeRef = function.getReturnTypeRef();
if (returnTypeRef != null) memberSuspects.add(returnTypeRef);
}
@Override
public void visitProperty(JetProperty property) {
PsiElement valOrVarNode = property.getValOrVarNode().getPsi();
if (valOrVarNode != null) memberSuspects.add(valOrVarNode);
JetTypeParameterList typeParameterList = property.getTypeParameterList();
if (typeParameterList != null) memberSuspects.add(typeParameterList);
JetTypeReference receiverTypeRef = property.getReceiverTypeRef();
if (receiverTypeRef != null) memberSuspects.add(receiverTypeRef);
JetTypeReference returnTypeRef = property.getTypeRef();
if (returnTypeRef != null) memberSuspects.add(returnTypeRef);
}
}
);
return memberSuspects;
}
@Nullable
private static LineRange adjustDeclarationRange(
@NotNull JetDeclaration declaration,
@NotNull Editor editor,
@NotNull LineRange lineRange
) {
Document doc = editor.getDocument();
TextRange textRange = declaration.getTextRange();
if (doc.getTextLength() < textRange.getEndOffset()) return null;
int startLine = editor.offsetToLogicalPosition(textRange.getStartOffset()).line;
int endLine = editor.offsetToLogicalPosition(textRange.getEndOffset()).line + 1;
if (startLine == lineRange.startLine || startLine == lineRange.endLine
|| endLine == lineRange.startLine || endLine == lineRange.endLine) {
return new LineRange(startLine, endLine);
}
TextRange lineTextRange = new TextRange(doc.getLineStartOffset(lineRange.startLine),
doc.getLineEndOffset(lineRange.endLine));
for (PsiElement anchor : getDeclarationAnchors(declaration)) {
TextRange suspectTextRange = anchor.getTextRange();
if (suspectTextRange != null && lineTextRange.intersects(suspectTextRange)) return new LineRange(startLine, endLine);
}
return null;
}
private static final Class[] DECLARATION_CONTAINER_CLASSES =
{JetClassBody.class, JetClassInitializer.class, JetFunction.class, JetPropertyAccessor.class, JetFile.class};
private static final Class[] CLASSBODYLIKE_DECLARATION_CONTAINER_CLASSES = {JetClassBody.class, JetFile.class};
@Nullable
private static JetDeclaration getMovableDeclaration(@Nullable PsiElement element) {
if (element == null) return null;
JetDeclaration declaration = PsiTreeUtil.getParentOfType(element, JetDeclaration.class, false);
return PsiTreeUtil.instanceOf(PsiTreeUtil.getParentOfType(declaration,
DECLARATION_CONTAINER_CLASSES),
CLASSBODYLIKE_DECLARATION_CONTAINER_CLASSES) ? declaration : null;
}
@Nullable
private static LineRange getSourceRange(
@NotNull JetDeclaration firstDecl,
@NotNull JetDeclaration lastDecl,
@NotNull Editor editor,
@NotNull LineRange oldRange
) {
if (firstDecl == lastDecl) {
LineRange range = adjustDeclarationRange(firstDecl, editor, oldRange);
if (range != null) {
range.firstElement = range.lastElement = firstDecl;
}
return range;
}
PsiElement parent = PsiTreeUtil.findCommonParent(firstDecl, lastDecl);
if (parent == null) return null;
Pair<PsiElement, PsiElement> combinedRange = getElementRange(parent, firstDecl, lastDecl);
if (combinedRange == null
|| !(combinedRange.first instanceof JetDeclaration)
|| !(combinedRange.second instanceof JetDeclaration)) {
return null;
}
LineRange lineRange1 = adjustDeclarationRange((JetDeclaration) combinedRange.getFirst(), editor, oldRange);
if (lineRange1 == null) return null;
LineRange lineRange2 = adjustDeclarationRange((JetDeclaration) combinedRange.getSecond(), editor, oldRange);
if (lineRange2 == null) return null;
LineRange range = new LineRange(lineRange1.startLine, lineRange2.endLine);
range.firstElement = combinedRange.getFirst();
range.lastElement = combinedRange.getSecond();
return range;
}
@Nullable
private static LineRange getTargetRange(
@NotNull Editor editor,
@NotNull PsiElement sibling,
boolean down,
@NotNull PsiElement target
) {
PsiElement start = sibling;
PsiElement end = sibling;
PsiElement nextParent = null;
// moving out of code block
if (sibling.getNode().getElementType() == (down ? JetTokens.RBRACE : JetTokens.LBRACE)) {
// elements which aren't immediately placed in class body can't leave the block
PsiElement parent = sibling.getParent();
if (!(parent instanceof JetClassBody)) return null;
JetClassOrObject jetClassOrObject = (JetClassOrObject) parent.getParent();
assert jetClassOrObject != null;
nextParent = jetClassOrObject.getParent();
// elements may be placed only to class body or file
if (!(nextParent instanceof JetFile || nextParent instanceof JetClassBody)) return null;
if (!down) {
start = jetClassOrObject;
}
}
// moving into code block
// element may move only into class body
else if (sibling instanceof JetClassOrObject) {
JetClassOrObject jetClassOrObject = (JetClassOrObject) sibling;
JetClassBody classBody = jetClassOrObject.getBody();
// confined elements can't leave their block
if (classBody != null) {
nextParent = classBody;
start = down ? jetClassOrObject : classBody.getRBrace();
end = down ? classBody.getLBrace() : classBody.getRBrace();
}
}
if (nextParent != null) {
if (target instanceof JetClassInitializer && !(nextParent instanceof JetClassBody)) return null;
if (target instanceof JetEnumEntry) {
if (!(nextParent instanceof JetClassBody)) return null;
JetClassOrObject nextClassOrObject = (JetClassOrObject) nextParent.getParent();
assert nextClassOrObject != null;
if (!nextClassOrObject.hasModifier(JetTokens.ENUM_KEYWORD)) return null;
}
}
if (target instanceof JetPropertyAccessor && !(sibling instanceof JetPropertyAccessor)) return null;
return start != null && end != null ? new LineRange(start, end, editor.getDocument()) : null;
}
@Override
public boolean checkAvailable(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) {
if (!super.checkAvailable(editor, file, info, down)) return false;
LineRange oldRange = info.toMove;
Pair<PsiElement, PsiElement> 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;
}
}
@@ -0,0 +1,6 @@
// MOVE: down
// IS_APPLICABLE: false
val x: String
<caret>get() {
return ""
}
@@ -0,0 +1,6 @@
// MOVE: up
// IS_APPLICABLE: false
val x: String
<caret>get() {
return ""
}
@@ -0,0 +1,8 @@
// MOVE: down
var x: String
<caret>get() {
return ""
}
set(v: String) {
// test
}
@@ -0,0 +1,8 @@
// MOVE: down
var x: String
set(v: String) {
// test
}
<caret>get() {
return ""
}
@@ -0,0 +1,8 @@
// MOVE: up
var x: String
get() {
return ""
}
<caret>set(v: String) {
// test
}
@@ -0,0 +1,8 @@
// MOVE: up
var x: String
<caret>set(v: String) {
// test
}
get() {
return ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val x = ""
<caret>class B {
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val x = ""
}
<caret>class B {
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>class B {
}
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: up
<caret>class B {
}
class A {
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
class B {
}
<caret>class B {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>class B {
}
class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
// IS_APPLICABLE: false
fun foo() {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: up
// IS_APPLICABLE: false
fun foo() {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>class B {
}
class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
}
<caret>class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
<caret>class B {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>class B {
}
{
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
{
}
<caret>class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
{
}
<caret>class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>class B {
}
{
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
<caret>class B {
}
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val y = ""
<caret>class B {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
val x = ""
<caret>class B {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>class B {
}
val x = ""
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>class B {
}
fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
fun foo() {
}
<caret>class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
fun foo() {
}
<caret>class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>class B {
}
fun foo() {
}
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
<caret>class B {
}
val y = ""
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
val y = ""
<caret>class B {
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
val y = ""
<caret>class B {
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
<caret>class B {
}
val y = ""
}
@@ -0,0 +1,7 @@
// MOVE: down
// IS_APPLICABLE: false
class B {
<caret>{
}
}
@@ -0,0 +1,7 @@
// MOVE: up
// IS_APPLICABLE: false
class B {
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>{
}
class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
class B {
<caret>{
}
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
}
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
<caret>{
}
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>{
}
{
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
{
}
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
{
}
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>{
}
{
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
<caret>{
}
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val y = ""
<caret>{
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
val x = ""
<caret>{
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>{
}
val x = ""
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>{
}
fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
fun foo() {
}
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
fun foo() {
}
<caret>{
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>{
}
fun foo() {
}
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
<caret>{
}
val y = ""
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
val y = ""
<caret>{
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
val y = ""
<caret>{
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
<caret>{
}
val y = ""
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
enum class B {
<caret>X
Y
}
}
@@ -0,0 +1,7 @@
// MOVE: down
class A {
enum class B {
Y
<caret>X
}
}
@@ -0,0 +1,8 @@
// MOVE: up
// IS_APPLICABLE: false
class A {
enum class B {
<caret>X
Y
}
}
@@ -0,0 +1,8 @@
// MOVE: down
// IS_APPLICABLE: false
class A {
enum class B {
X
<caret>Y
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
enum class B {
X
<caret>Y
}
}
@@ -0,0 +1,7 @@
// MOVE: up
class A {
enum class B {
<caret>Y
X
}
}
@@ -0,0 +1,10 @@
// MOVE: up
enum class A {
U
V
enum class B {
<caret>X
Y
}
}
@@ -0,0 +1,10 @@
// MOVE: up
enum class A {
U
V
<caret>X
enum class B {
Y
}
}
@@ -0,0 +1,10 @@
// MOVE: down
enum class A {
U
V
enum class B {
X
<caret>Y
}
}
@@ -0,0 +1,10 @@
// MOVE: down
enum class A {
U
V
enum class B {
X
}
<caret>Y
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val x = ""
<caret>fun foo() {
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val x = ""
}
<caret>fun foo() {
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>fun foo() {
}
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: up
<caret>fun foo() {
}
class A {
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
class B {
}
<caret>fun foo() {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>fun foo() {
}
class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
// IS_APPLICABLE: false
fun foo() {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: up
// IS_APPLICABLE: false
fun foo() {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>fun foo() {
}
class B {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
}
<caret>fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
class B {
<caret>fun foo() {
}
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>fun foo() {
}
{
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
{
}
<caret>fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
{
}
<caret>fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>fun foo() {
}
{
}
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
<caret>fun foo() {
}
val y = ""
}
@@ -0,0 +1,8 @@
// MOVE: down
class A {
val y = ""
<caret>fun foo() {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
val x = ""
<caret>fun foo() {
}
}
@@ -0,0 +1,8 @@
// MOVE: up
class A {
<caret>fun foo() {
}
val x = ""
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
<caret>fun foo() {
}
fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: down
class A {
fun foo() {
}
<caret>fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
fun foo() {
}
<caret>fun foo() {
}
}
@@ -0,0 +1,9 @@
// MOVE: up
class A {
<caret>fun foo() {
}
fun foo() {
}
}

Some files were not shown because too many files have changed in this diff Show More