Skip to content

Commit

Permalink
Fix indent with get/set and line-separated variable assignment (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
yukukotani authored and Tapchicoma committed Oct 3, 2019
1 parent dab8b81 commit 7f8b89a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,16 @@ class IndentationRule : Rule("indent"), Rule.Modifier.RestrictToRootLast {
node.treeParent?.elementType.let { it == TYPE_PARAMETER_LIST || it == TYPE_ARGUMENT_LIST } ->
0
nextLeafElementType in rTokenSet -> -1
// IDEA quirk:
// var value: DataClass =
// DataClass("too long line")
// private set
//
// instead of expected:
// var value: DataClass =
// DataClass("too long line")
// private set
node.nextCodeSibling()?.elementType == PROPERTY_ACCESSOR && node.treeParent.findChildByType(EQ)?.nextLeaf().isWhiteSpaceWithNewline() -> -1
else -> 0
}
// indentation with all \t replaced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class A {

var setterWithAnnotation: Any? = null
@Inject set
var multilineInitialValue: String =
"tooooooooooooo loooooooooooooooong"
private set
}

// expect
// 3:1:Unexpected indentation (4) (should be 8)
// 34:1:Unexpected indentation (12) (should be 8)

0 comments on commit 7f8b89a

Please sign in to comment.