nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
158 stars 23 forks source link

Suppress annotation inserted at incorrect location resulting in compilation error #393

Closed paul-dingemans closed 8 months ago

paul-dingemans commented 9 months ago

Version: 0.20.0-beta-4

Given code below, in which the string is just one character too long to fit the statement on a single line:

fun foo() {
    bar(
        "Too longgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
    )
}

Screenshot 2023-12-02 at 21 48 27

Suppressing the max-line-length in dialog above, result in erroneous code below:

fun foo() {
    bar("@Suppress("ktlint:standard:max-line-length")
    Too longgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg"
    )
}

Screenshot 2023-12-02 at 21 49 37

paul-dingemans commented 9 months ago

This will be fixed by #403 but can not be resolved before ktlint 1.1.x has been released.