json5k icon indicating copy to clipboard operation
json5k copied to clipboard

An idea / suggestion about comment

Open AmibeSkyfy16 opened this issue 2 years ago • 0 comments

Allow us to decide how many time a comment will be written. In relation with @SerialComment

Example: json5 example : https://pastebin.com/dfsT84BM

Idea: Add an annotation called @SerialSettings that allow us to specific more things about comment

@SerialSettings(firstOccurenceComment = true)
@Serializable
data class Rule(
    @SerialComment("The maximum number of homes")
    val maxHomes: Int = 3,
    @SerialComment("The number of seconds you have to wait before teleporting a new time")
    val cooldown: Int = 15,
    @SerialComment("The number of seconds to remain standing without moving more than 2 blocks before the teleportation is effective")
    val standStill: Int = 5,
    @SerialComment("Names of some extensions (Experience (teleporting cost XP), TheMoney (teleporting cost money), etc.)")
    val extensionName: String,
    @SerialComment("The name of a bonus group. Allow you to give some extra bonus (effect, items, xp) after a teleportation")
    val groupBonusName: String,
)

With this code, it will produce this: https://pastebin.com/L42vjwpz

AmibeSkyfy16 avatar Jan 30 '23 10:01 AmibeSkyfy16