Skip to content

Commit

Permalink
Fix formatting in case when there are block comments right before dec…
Browse files Browse the repository at this point in the history
…larations
  • Loading branch information
zarechenskiy committed Jun 2, 2016
1 parent acbd99b commit caeddf5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,9 @@ public void formatSelection() {
public void respectCaretAfterFormatting() {
doAutoTest();
}

@Test
public void blockCommentBeforeDeclaration() {
doAutoTest();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Cls{
/*
*/
fun test() {}

/*
*/
val vls = 1

/*
*/
companion object {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Cls {
/*
*/
fun test() {
}

/*
*/
val vls = 1

/*
*/
companion object {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public TextRange replaceWhiteSpace(TextRange textRange, @Nullable ASTNode nodeAf
@Override
public TextRange shiftIndentInsideRange(ASTNode node, TextRange range, int indent) {
try {
int newLength = shiftIndentInside(range, indent);
return new TextRange(range.getStartOffset(), range.getStartOffset() + newLength);
shiftIndentInside(range, indent);
return range;
} catch (BadLocationException e) {
KotlinLogger.logAndThrow(e);
}
Expand Down

0 comments on commit caeddf5

Please sign in to comment.