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

ValueArgument

class ValueArgument : Scope<KtValueArgument>

(if (!argumentName.toString().isNullOrEmpty()) “”“$argumentName = $argumentExpression””” else “”“$argumentExpression”””).argument

A template destructuring Scope for a ValueArgument.

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

val Meta.reformatValueArg: CliPlugin
 get() =
  "ReformatValueArg" {
   meta(
    valueArgument(this, { true }) { e ->
     Transform.replace(
      replacing = e,
      newDeclaration = (if (!argumentName.toString().isNullOrEmpty()) """$argumentName = $argumentExpression""" else  """$argumentExpression""").argument
     )
     }
    )
   }

Constructors

<init> (if (!argumentName.toString().isNullOrEmpty()) “”“$argumentName = $argumentExpression””” else “”“$argumentExpression”””).argumentValueArgument(value: KtValueArgument, argumentExpression: Scope<KtExpression>? = Scope(value.getArgumentExpression()), argumentName: Scope<KtValueArgumentName>? = Scope(value.getArgumentName()))

Properties

argumentExpression val argumentExpression: Scope<KtExpression>?
argumentName val argumentName: Scope<KtValueArgumentName>?
value val value: KtValueArgument

Functions

identity fun ElementScope.identity(): ValueArgument

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
<