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

Running format on functions with annotations above params reindents only the annotation #161

Closed
jeremymailen opened this issue Feb 28, 2018 · 1 comment

Comments

@jeremymailen
Copy link
Contributor

If you take a source file with annotations above parameters like this:

import org.jetbrains.annotations.Nullable

class Tester {

    fun annotated(@Nullable
                  param: String) {
        println("nullable $param")
    }
}

ktlint -F Test.kt
You'll get:

import org.jetbrains.annotations.Nullable

class Tester {

    fun annotated(
        @Nullable
                  param: String
    ) {
        println("nullable $param")
    }
}

The workaround is that you can manually fix the indent of the param and ktlint will accept that too.

@shyiko
Copy link
Collaborator

shyiko commented Feb 28, 2018

Thank you, Jeremy. Fixed in 0.17.0 (Maven Central sync might take up to 25 minutes).

@shyiko shyiko closed this as completed Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants