compiler-plugin / arrow.meta.quotes.classorobject / ObjectDeclaration / <init>

<init>

ObjectDeclaration(value: KtObjectDeclaration)

””” object $name { $body }””“.objectDeclaration

A template destructuring Scope for a KtObjectDeclaration.

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

val Meta.reformatObjectDeclaration: CliPlugin
   get() =
     "ReformatObjectDeclaration" {
       meta(
         objectDeclaration(this, { isObjectLiteral() }) { c ->
           Transform.replace(
             replacing = c,
             newDeclaration = """
                 | $`@annotations` object $name $superTypes {
                 |   $body
                 | }
                 | """.`object`
             )
           }
         )
       }

Do you like Arrow?

Arrow Org
<