compiler-plugin / arrow.meta.quotes.classorobject / ObjectDeclaration
class ObjectDeclaration :
ClassOrObjectScope
<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`
)
}
)
}
<init> | ””” object $name { $body }””“.objectDeclarationObjectDeclaration(value: KtObjectDeclaration) |
value | val value: KtObjectDeclaration |
identity | fun ElementScope .identity(): ObjectDeclaration |
allConstructors | val <T : KtClassOrObject> ClassOrObjectScope <T>.allConstructors: ScopedList <KtConstructor<*>> |
getOrCreateBody | fun <T : KtClassOrObject> ClassOrObjectScope <T>.getOrCreateBody(): Scope <KtClassBody> |
map | fun <K : KtElement> Scope <K>.map(f: (K) -> K): Scope <K> |
orEmpty | fun <K : KtElement> Scope <K>?.orEmpty(): Scope <K> |
refinementExpression | fun ObjectDeclaration .refinementExpression(): String ? |
Do you like Arrow?
✖