compiler-plugin / arrow.meta.quotes.element / ImportDirective
class ImportDirective :
Scope
<KtImportDirective>
importDirective(ImportPath(importedFqName, isAllUnder, alias))
A template destructuring Scope for a KtImportDirective.
import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.importDirective
import org.jetbrains.kotlin.resolve.ImportPath
val Meta.reformatImportDirective: CliPlugin
get() =
"ReformatImportDirective" {
meta(
importDirective(this, { true }) { e ->
Transform.replace(
replacing = e,
newDeclaration = importDirective(ImportPath(importedFqName, isAllUnder, alias))
)
}
)
}
<init> | importDirective(ImportPath(importedFqName, isAllUnder, alias))ImportDirective(value: KtImportDirective?, importedFqName: FqName = value?.importedFqName!!, isAllUnder: Boolean = value?.isAllUnder == true, alias: Name? = value?.aliasName?.let(Name::identifier)) |
alias | val alias: Name? |
importedFqName | val importedFqName: FqName |
isAllUnder | val isAllUnder: Boolean |
value | val value: KtImportDirective? |
identity | fun ElementScope .identity(): ImportDirective |
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?
✖