Is there any settting in the IDE (or kotlin-plugin...
# announcements
i
Is there any settting in the IDE (or kotlin-plugin) that would allow me to keep annotations code formatting in the same line inside enum? Now
Copy code
enum class LastFmImageSize {
    @field:Json(name = "medium")
    MEDIUM,
    @field:Json(name = "small")
    SMALL
}
Want
Copy code
enum class LastFmImageSize {
    @field:Json(name = "medium") MEDIUM,
    @field:Json(name = "small") SMALL
}
h
I don't think so, and I think it's intentional: https://kotlinlang.slack.com/archives/C4GKV43N2/p1541147812006200
i
IMHO I think Annotation formatting seems to be a bit inconsistent:
Copy code
data class Album(
@field:Json(name = "abc") val artistName: String,
@field:Json(name = "cde") val albumTitle: String
)
Copy code
enum class LastFmImageSize {
    @field:Json(name = "medium")
    MEDIUM,
    @field:Json(name = "extralarge")
    EXTRA_LARGE
}
We can argue that the data class has constructor with parameters while enum defines just a series of costs, however In practice, we would think about enum costs more like class constructor parameters them properties defined in the class (they are separated by comma after all)
BTW I see this should go to #C4GKV43N2 (Next time I will remember about starting thread there)
a
This is just not implemented, please vote for https://youtrack.jetbrains.com/issue/KT-26796
👍 1