compiler-plugin / arrow.meta.quotes.element / PackageDirective

PackageDirective

data class PackageDirective : Scope<KtPackageDirective>

””” $package “””.package

A template destructuring Scope for a KtPackageDirective.

``kotlin:ank:silent import arrow.meta.Meta import arrow.meta.CliPlugin import arrow.meta.invoke import arrow.meta.quotes.Transform import arrow.meta.quotes.packageDirective

val Meta.reformatPackage: CliPlugin get() = “ReformatPackage” { meta( packageDirective({ true }) { e -> Transform.replace( replacing = e, newDeclaration = “”” $package “””.package ) } ) }

Constructors

| <init> | “”” $package “””.packagePackageDirective(value: KtPackageDirective?, package: Scope<KtElement> = Scope(value?.packageNameExpression), packages: ScopedList<KtSimpleNameExpression> = ScopedList( value = value?.packageNames ?: listOf(), separator = "." ), lastPackage: Scope<KtSimpleNameExpression> = Scope(value?.lastReferenceExpression)) |

Properties

lastPackage val lastPackage: Scope<KtSimpleNameExpression>
package val package: Scope<KtElement>
packages val packages: ScopedList<KtSimpleNameExpression>
value val value: KtPackageDirective?

Functions

identity fun ElementScope.identity(): Scope<KtPackageDirective>

Extension Functions

map fun <K : KtElement> Scope<K>.map(f: (K) -> K): Scope<K>
orEmpty fun <K : KtElement> Scope<K>?.orEmpty(): Scope<K>

Do you like Arrow?

Arrow Org
<