compiler-plugin / arrow.meta.quotes.expression / TryExpression
class TryExpression :
Scope
<KtTryExpression>
”"”try $tryBlock$catchClauses$finallySection”””.try
A template destructuring Scope for a KtTryExpression.
import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.tryExpression
val Meta.reformatTry: CliPlugin
get() =
"Reformat Try Expression" {
meta(
tryExpression(this, { true }) { expression ->
Transform.replace(
replacing = expression,
newDeclaration = """try $tryBlock$catchClauses$finallySection""".`try`
)
}
)
}
<init> | ”"”try $tryBlock$catchClauses$finallySection”””.try TryExpression(value: KtTryExpression?, tryBlock: BlockExpression = BlockExpression(value?.tryBlock), catchClauses: ScopedList <KtCatchClause> = ScopedList(value = value?.catchClauses.orEmpty()), finallySection: FinallySection = FinallySection(value?.finallyBlock)) |
catchClauses | val catchClauses: ScopedList <KtCatchClause> |
finallySection | val finallySection: FinallySection |
tryBlock | val tryBlock: BlockExpression |
value | val value: KtTryExpression? |
identity | fun ElementScope .identity(): TryExpression |
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?
✖