compiler-plugin / arrow.meta.quotes.element.whencondition / WhenCondition / <init>

<init>

WhenCondition(value: KtWhenCondition?, condition: String = value?.text ?: "")

condition.whenCondition

A template destructuring Scope for a KtWhenCondition.

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.whenCondition

val Meta.reformatWhenCondition: CliPlugin
 get() =
  "ReformatWhenCondition" {
   meta(
    whenCondition(this, { true }) { c ->
     Transform.replace(
      replacing = c,
      newDeclaration = condition.whenCondition
     )
    }
   )
  }

Do you like Arrow?

Arrow Org
<