mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-99510 (Move statement up/down behaves unexpectedly when used on class level annotation)
This commit is contained in:
+1
-2
@@ -101,7 +101,6 @@ class DeclarationMover extends LineMover {
|
||||
Document document = editor.getDocument();
|
||||
|
||||
PsiElement sibling = down ? range.lastElement.getNextSibling() : range.firstElement.getPrevSibling();
|
||||
if (sibling == null) return false;
|
||||
sibling = firstNonWhiteElement(sibling, down);
|
||||
final boolean areWeMovingClass = range.firstElement instanceof PsiClass;
|
||||
info.toMove = range;
|
||||
@@ -179,7 +178,7 @@ class DeclarationMover extends LineMover {
|
||||
// throws IllegalMoveException when corresponding movement has no sense
|
||||
@Nullable
|
||||
private LineRange moveInsideOutsideClassPosition(Editor editor, PsiElement sibling, final boolean isDown, boolean areWeMovingClass) throws IllegalMoveException{
|
||||
if (sibling == null) throw new IllegalMoveException();
|
||||
if (sibling == null || sibling instanceof PsiImportList) throw new IllegalMoveException();
|
||||
if (sibling instanceof PsiJavaToken &&
|
||||
((PsiJavaToken)sibling).getTokenType() == (isDown ? JavaTokenType.RBRACE : JavaTokenType.LBRACE) &&
|
||||
sibling.getParent() instanceof PsiClass) {
|
||||
|
||||
Reference in New Issue
Block a user