Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix indentation with lambda argument, Fix #622 #627

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class IndentationRule : Rule("indent"), Rule.Modifier.RestrictToRootLast {
}

private fun adjustExpectedIndentInsideQualifiedExpression(n: ASTNode, ctx: IndentContext) {
val p = n.treeParent
val p = n.parent({ it.treeParent.elementType != DOT_QUALIFIED_EXPRESSION }) ?: return
val nextSibling = n.treeNext
if (!ctx.ignored.contains(p) && nextSibling != null) {
expectedIndent++
Expand All @@ -628,7 +628,8 @@ class IndentationRule : Rule("indent"), Rule.Modifier.RestrictToRootLast {
} else {
nextSibling
}
ctx.exitAdjBy(e, -1)
ctx.ignored.add(p)
ctx.exitAdjBy(p, -1)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public class ThisIsASampleClass :
}
}

fun foo3() {
Integer
.parseInt("32").let {
println("parsed $it")
}
}

private val f =
{ a: Int -> a * 2 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ return 2
}
}

fun foo3() {
Integer
.parseInt("32").let {
println("parsed $it")
}
}

private val f =
{ a: Int -> a * 2 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ fun f4() = "${
true
}"

fun f5() {
Integer
.parseInt("32").let {
println("parsed $it")
}
}

// expect