-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline lambda parameters #54
Labels
Comments
#53 will fix this. class Test {
fun tryAdd(a: Int?, b: Int?): Int? {
var result: Int? = null
a?.let { lhs ->
b?.let { rhs ->
result = lhs + rhs
}
}
return result
}
} class Test {
fun tryAdd(a: Int?, b: Int?): Int? {
var result: Int? = null
a?.let { lhs ->
val test = "variable assignment"
val anotherVariable = "another"
b?.let { rhs ->
result = lhs + rhs
}
}
return result
}
} foo {
context: Context,
environment: Env
->
context.configureEnv(environment)
}
foo { context: Context, // Non-standard style
environment: Env
->
context.configureEnv(environment)
} |
I'll give that a try. Thanks! |
This still does not work, does it? assets.open(name).use { source ->
// indents here
} Please reopen. #53 seems to have stalled. |
I was also annoyed by this and have an MR up to fix it: #73 |
Now fixed as #53 is merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the Code Convention documentation:
So the example should probably read:
However, when putting parameters on the first line Kotlin-mode will indent the next line as follows:
Further when adding normal declarations like variable assignment the first line is indented further than the remaining lines in the lambda:
The text was updated successfully, but these errors were encountered: