Fix trailing lambda with chained call indentation (#589)#626
Conversation
|
@hick209 has imported this pull request. If you are a Meta employee, you can view this in D108649008. |
|
This said no internal changes here. Which is odd, I was expecting a bunch of them. |
|
@hick209 tell me if you need me to add more tests or fix something. |
|
Oops, look at me not keeping my promises. Sorry about that, will look at it again right now! |
hick209
left a comment
There was a problem hiding this comment.
Yes, this is incomplete as I suspected.
Here's the test I made, which I thought should happen the other way around
@Test
fun nivaldo_test() {
// this passed
assertFormatted(
"""
|fun quux() {
| runnnnn {
| foo()
| bar()
| }
| .baz()
|}
|"""
.trimMargin()
)
// this failed
assertFormatted(
"""
|fun quux() {
| runnnnn {
| foo()
| bar()
| }
| .baz()
|}
|"""
.trimMargin()
)
}
Please LMK if I'm missing something here.
Also don't forget to update the CHANGELOG.md so I don't forget to give you proper attribution
6aeba2f to
c94e0d5
Compare
Hmmm, sorry, it seems I forgot half of the issue... I fixed it and added a bunch more tests.
Done. I applied the new formatting (1 change in |
c94e0d5 to
d69e01b
Compare
|
It still says no changes in our mega repo 🤔 Maybe we are missing something here. Let me test it out further to see if we are missing any use case Edit: This might actually be a bug on our end here. I'm investigating Thanks for the awesome work! |
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This PR fixes the indentation of trailing lambda with chained calls.
See #589.
I used an AI agent to understand how
ktfmtandgoogle-java-formatwork. This PR has been implemented with the help of an AI agent. I don't know much about the PSI AST shapes, so I wouldn't be surprised if the AST tests and visits are not general enough, or simply wrong.