in build-logic/generatorlegacybuild/src/main/kotlin/karakum/csstype/ColorProperty.kt [21:41]
override fun apply(
items: List<ConversionResult>,
): List<ConversionResult> {
val parentTypes = items.asSequence()
.filter { marker in it.body }
.map { it.name }
.plus(BACKGROUND)
.plus(BORDER)
.plus(OUTLINE)
.sorted()
.joinToString(",\n")
val result = items.map { it.copy(body = it.body.replace(marker, "")) }
val oldType = result.first { it.name == COLOR_PROPERTY }
val newBody = oldType.body
.replaceFirst("// Globals | DataType.Color\n", "")
.replaceFirst(COLOR_PROPERTY, "$COLOR_PROPERTY:\n$parentTypes")
val newType = oldType.copy(body = newBody)
return result - oldType + newType
}