Skip to content
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

Incorrect indentation with multiple elvis operators and multiline statements #393

Closed
att14 opened this issue Mar 13, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@att14
Copy link

att14 commented Mar 13, 2023

Current behavior:

val foo =
    existingFoo
        ?: fooRepository.findExisting(
            bar = "baz",
        )
            ?: Foo(
            bar = "baz",
        )

Expected behavior:

val foo =
    existingFoo
        ?: fooRepository.findExisting(
            bar = "baz",
        )
            ?: Foo(
                bar = "baz",
            )
  • Using comma here to force multiline statements, but the same behavior occurs with long statements without trailing comma.
@hick209 hick209 added the bug Something isn't working label Sep 19, 2023
@nreid260
Copy link
Contributor

I think this was fixed by #416

@hick209 hick209 closed this as completed Mar 26, 2024
@hick209
Copy link
Contributor

hick209 commented Mar 26, 2024

Closed since now the mentioned code formats to:

val foo =
    existingFoo
        ?: fooRepository.findExisting(
            bar = "baz",
        )
        ?: Foo(
            bar = "baz",
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants