compiler-plugin / arrow.meta / Meta

Meta

interface Meta : ComponentRegistrar, MetaPluginSyntax, InternalRegistry

Meta is the core entry point and impl of Arrow Meta in terms of its registration system and interface with the Kotlin Compiler

Plugin authors are encouraged to define CliPlugin extensions by making them part of the Meta receiver:

val Meta.helloWorld: CliPlugin get() =
  "Hello World" {
    meta(
      ...
    )
  }

The Meta receiver provides automatic syntax for everything the user needs to build plugins through delegation to MetaPluginSyntax and providing the internal implementation to the compiler subscriptions via InternalRegistry

Functions

intercept The Meta plugin supports N numbers of local and remote sub CliPlugin that provide a List of ExtensionPhase subscriptions. registerProjectComponents implementation calls intercept to deliver subscriptions to the Kotlin Compiler in the right order.abstract fun intercept(ctx: CompilerContext): List<CliPlugin>
registerProjectComponents CLI Compiler ComponentRegistrar entry point.open fun registerProjectComponents(project: MockProject, configuration: CompilerConfiguration): Unit

Extension Properties

comprehensions val Meta.comprehensions: CliPlugin
helloWorld The following example shows a Hello World Compiler Plugin.val Meta.helloWorld: CliPlugin
higherKindedTypes2 val Meta.higherKindedTypes2: CliPlugin
lenses val Meta.lenses: CliPlugin
typeProofs val Meta.typeProofs: CliPlugin

Extension Functions

binaryExpression fun Meta.binaryExpression(match: KtBinaryExpression.() -> Boolean, map: BinaryExpression.(KtBinaryExpression) -> Transform<KtBinaryExpression>): ExtensionPhase
blockExpression fun Meta.blockExpression(match: KtBlockExpression.() -> Boolean, map: BlockExpression.(KtBlockExpression) -> Transform<KtBlockExpression>): ExtensionPhase
breakExpression fun Meta.breakExpression(match: KtBreakExpression.() -> Boolean, map: BreakExpression.(KtBreakExpression) -> Transform<KtBreakExpression>): ExtensionPhase
catchClause fun Meta.catchClause(match: KtCatchClause.() -> Boolean, map: CatchClause.(KtCatchClause) -> Transform<KtCatchClause>): ExtensionPhase
classBody fun Meta.classBody(match: KtClassBody.() -> Boolean, map: ClassBody.(KtClassBody) -> Transform<KtClassBody>): ExtensionPhase
classDeclaration fun Meta.classDeclaration(match: KtClass.() -> Boolean, map: ClassDeclaration.(KtClass) -> Transform<KtClass>): ExtensionPhase
continueExpression fun Meta.continueExpression(match: KtContinueExpression.() -> Boolean, map: ContinueExpression.(KtContinueExpression) -> Transform<KtContinueExpression>): ExtensionPhase
destructuringDeclaration fun Meta.destructuringDeclaration(match: KtDestructuringDeclaration.() -> Boolean, map: DestructuringDeclaration.(KtDestructuringDeclaration) -> Transform<KtDestructuringDeclaration>): ExtensionPhase
dotQualifiedExpression fun Meta.dotQualifiedExpression(match: KtDotQualifiedExpression.() -> Boolean, map: DotQualifiedExpression.(KtDotQualifiedExpression) -> Transform<KtDotQualifiedExpression>): ExtensionPhase
enableProofCallResolver fun Meta.enableProofCallResolver(): ExtensionPhase
file fun Meta.file(match: KtFile.() -> Boolean, map: File.(KtFile) -> Transform<KtFile>): ExtensionPhase
finallySection fun Meta.finallySection(match: KtFinallySection.() -> Boolean, map: FinallySection.(KtFinallySection) -> Transform<KtFinallySection>): ExtensionPhase
forExpression fun Meta.forExpression(match: KtForExpression.() -> Boolean, map: ForExpression.(KtForExpression) -> Transform<KtForExpression>): ExtensionPhase
functionLiteral fun Meta.functionLiteral(match: KtFunctionLiteral.() -> Boolean, map: FunctionLiteral.(KtFunctionLiteral) -> Transform<KtFunctionLiteral>): ExtensionPhase
ifExpression fun Meta.ifExpression(match: KtIfExpression.() -> Boolean, map: IfExpression.(KtIfExpression) -> Transform<KtIfExpression>): ExtensionPhase
importDirective fun Meta.importDirective(match: KtImportDirective.() -> Boolean, map: ImportDirective.(KtImportDirective) -> Transform<KtImportDirective>): ExtensionPhase
isExpression fun Meta.isExpression(match: KtIsExpression.() -> Boolean, map: IsExpression.(KtIsExpression) -> Transform<KtIsExpression>): ExtensionPhase
lambdaExpression fun Meta.lambdaExpression(match: KtLambdaExpression.() -> Boolean, map: LambdaExpression.(KtLambdaExpression) -> Transform<KtLambdaExpression>): ExtensionPhase
namedFunction fun Meta.namedFunction(match: KtNamedFunction.() -> Boolean, map: NamedFunction.(KtNamedFunction) -> Transform<KtNamedFunction>): ExtensionPhase
objectDeclaration fun Meta.objectDeclaration(match: KtObjectDeclaration.() -> Boolean, map: ObjectDeclaration.(KtObjectDeclaration) -> Transform<KtObjectDeclaration>): ExtensionPhase
packageDirective fun Meta.packageDirective(match: KtPackageDirective.() -> Boolean, map: PackageDirective.(KtPackageDirective) -> Transform<KtPackageDirective>): ExtensionPhase
parameter fun Meta.parameter(match: KtParameter.() -> Boolean, map: Parameter.(KtParameter) -> Transform<KtParameter>): ExtensionPhase
property fun Meta.property(match: KtProperty.() -> Boolean, map: Property.(KtProperty) -> Transform<KtProperty>): ExtensionPhase
propertyAccessor fun Meta.propertyAccessor(match: KtPropertyAccessor.() -> Boolean, map: PropertyAccessor.(KtPropertyAccessor) -> Transform<KtPropertyAccessor>): ExtensionPhase
provenSyntheticScope fun Meta.provenSyntheticScope(): ExtensionPhase
quote fun <K : KtElement> Meta.quote(match: K.() -> Boolean, map: Scope<K>.(K) -> Transform<K>): ExtensionPhase
fun <K : KtElement, S : Scope<K>> Meta.quote(match: K.() -> Boolean, map: S.(K) -> Transform<K>, transform: (K) -> S): ExtensionPhase
fun <P : KtElement, K : KtElement, S> Meta.quote(quoteFactory: Factory<P, K, S>, match: K.() -> Boolean, map: S.(K) -> Transform<K>): ExtensionPhase
returnExpression fun Meta.returnExpression(match: KtReturnExpression.() -> Boolean, map: ReturnExpression.(KtReturnExpression) -> Transform<KtReturnExpression>): ExtensionPhase
thisExpression fun Meta.thisExpression(match: KtThisExpression.() -> Boolean, map: ThisExpression.(KtThisExpression) -> Transform<KtThisExpression>): ExtensionPhase
throwExpression fun Meta.throwExpression(match: KtThrowExpression.() -> Boolean, map: ThrowExpression.(KtThrowExpression) -> Transform<KtThrowExpression>): ExtensionPhase
tryExpression fun Meta.tryExpression(match: KtTryExpression.() -> Boolean, map: TryExpression.(KtTryExpression) -> Transform<KtTryExpression>): ExtensionPhase
typeAlias fun Meta.typeAlias(match: KtTypeAlias.() -> Boolean, map: TypeAlias.(KtTypeAlias) -> Transform<KtTypeAlias>): ExtensionPhase
typeReference fun Meta.typeReference(match: KtTypeReference.() -> Boolean, map: TypeReference.(KtTypeReference) -> Transform<KtTypeReference>): ExtensionPhase
valueArgument ”"”someObject.add(${argumentName = argumentExpression}.valueArgument)”””“fun Meta.valueArgument(match: KtValueArgument.() -> Boolean, map: ValueArgument.(KtValueArgument) -> Transform<KtValueArgument>): ExtensionPhase
whenCondition fun Meta.whenCondition(match: KtWhenCondition.() -> Boolean, map: WhenCondition.(KtWhenCondition) -> Transform<KtWhenCondition>): ExtensionPhase
whenEntry fun Meta.whenEntry(match: KtWhenEntry.() -> Boolean, map: WhenEntry.(KtWhenEntry) -> Transform<KtWhenEntry>): ExtensionPhase
whenExpression fun Meta.whenExpression(match: KtWhenExpression.() -> Boolean, map: WhenExpression.(KtWhenExpression) -> Transform<KtWhenExpression>): ExtensionPhase
whileExpression fun Meta.whileExpression(match: KtWhileExpression.() -> Boolean, map: WhileExpression.(KtWhileExpression) -> Transform<KtWhileExpression>): ExtensionPhase

Inheritors

MetaPlugin The Meta Plugin contains the default meta bundled plugins for Arrowopen class MetaPlugin : Meta

Do you like Arrow?

Arrow Org
<