compiler-plugin / arrow.meta.phases / CompilerContext

CompilerContext

open class CompilerContext : ElementScope

The Compiler Context represents the environment received by all plugins. The Compiler Context will get more services as they become relevant overtime to the development of compiler plugins.

Constructors

| <init> | The Compiler Context represents the environment received by all plugins. The Compiler Context will get more services as they become relevant overtime to the development of compiler plugins.CompilerContext(project: Project, messageCollector: MessageCollector? = null, scope: ElementScope = ElementScope.default(project), ktPsiElementFactory: KtPsiFactory = KtPsiFactory(project, false), eval: (String) -> Any? = { KotlinJsr223JvmLocalScriptEngineFactory().scriptEngine.eval(it) }) |

Properties

analysedDescriptors val analysedDescriptors: MutableList<DeclarationDescriptor>
analysisPhaseCanBeRewind val analysisPhaseCanBeRewind: AtomicBoolean
analysisPhaseWasRewind val analysisPhaseWasRewind: AtomicBoolean
componentProvider var componentProvider: ComponentProvider?
configuration var configuration: CompilerConfiguration?
ctx val ctx: CompilerContext
eval val eval: (String) -> Any?
ktPsiElementFactory val ktPsiElementFactory: KtPsiFactory
messageCollector val messageCollector: MessageCollector?
module var module: ModuleDescriptor?
project open val project: Project
proofCache val proofCache: ConcurrentHashMap<ModuleDescriptor, ProofsCache>
proofs val ModuleDescriptor?.proofs: List<Proof>
quotes val quotes: MutableList<QuoteDefinition<out KtElement, out KtElement, out Scope<KtElement>>>
scope val scope: ElementScope

Extension Functions

allGivenProofs returns a Map, where the keys are KotlinType and the values are all corresponding proofs without refining the list as it is done in givenProofs.fun CompilerContext.allGivenProofs(): Map<KotlinType, List<GivenProof>>
areTypesCoerced fun CompilerContext?.areTypesCoerced(subType: KotlinType, supertype: KotlinType): Boolean
cachedModule fun CompilerContext.cachedModule(name: Name): ModuleDescriptor?
changeSource fun CompilerContext.changeSource(file: KtFile, newSource: String, rootFile: KtFile, sourcePath: String? = null): KtFile
coerceProof fun CompilerContext.coerceProof(subType: KotlinType, superType: KotlinType): CoercionProof?
coerceProofs fun CompilerContext.coerceProofs(subType: KotlinType, superType: KotlinType): List<CoercionProof>
disposeProofCache fun CompilerContext.disposeProofCache(): Unit
evaluateDependsOn fun <T> CompilerContext.evaluateDependsOn(noRewindablePhase: () -> T?, rewindablePhase: (Boolean) -> T?): T?
evaluateDependsOnRewindableAnalysisPhase fun <T> CompilerContext.evaluateDependsOnRewindableAnalysisPhase(evaluation: () -> T?): T?
extending fun CompilerContext.extending(types: Collection<KotlinType>): List<ExtensionProof>
extensionProof fun CompilerContext.extensionProof(subType: KotlinType, superType: KotlinType): ExtensionProof?
extensionProofCandidate fun CompilerContext.extensionProofCandidate(candidates: List<ExtensionProof>): ExtensionProof?
extensionProofs fun CompilerContext.extensionProofs(subType: KotlinType, superType: KotlinType): List<ExtensionProof>
returns a Map, where the keys are from KotlinType -> to KotlinType and the values are the corresponding Proofsfun CompilerContext.extensionProofs(): Map<Pair<KotlinType, KotlinType>, List<ExtensionProof>>
generateGivenExtensionsFile fun CompilerContext.generateGivenExtensionsFile(meta: Meta): ExtensionPhase
givenProof fun CompilerContext.givenProof(superType: KotlinType): GivenProof?
givenProofCandidate fun CompilerContext.givenProofCandidate(candidates: List<GivenProof>): GivenProof?
givenProofs fun CompilerContext.givenProofs(superType: KotlinType): List<GivenProof>
contrary to allGivenProofs it refines the List as it is done in givenProofsfun CompilerContext.givenProofs(): Map<KotlinType, List<GivenProof>>
ownershipViolations fun CompilerContext.ownershipViolations(trace: BindingContext, file: KtFile): List<Pair<KtDeclaration, Proof>>
process fun CompilerContext.process(elements: List<ADT>): List<File>
proof fun <P : Proof> CompilerContext.proof(): List<P>
refinementProofs returns a Map, where the keys represent refinements from KotlinType -> to KotlinType and the values are the corresponding Proofsfun CompilerContext.refinementProofs(): Map<Pair<KotlinType, KotlinType>, List<RefinementProof>>
suppressConstantExpectedTypeMismatch fun CompilerContext.suppressConstantExpectedTypeMismatch(diagnostic: Diagnostic): Boolean
suppressProvenTypeMismatch fun CompilerContext.suppressProvenTypeMismatch(diagnostic: Diagnostic): Boolean
suppressTypeInferenceExpectedTypeMismatch fun CompilerContext.suppressTypeInferenceExpectedTypeMismatch(diagnostic: Diagnostic): Boolean
syntheticMemberFunctions fun CompilerContext.syntheticMemberFunctions(receiverTypes: Collection<KotlinType>, name: Name): List<SimpleFunctionDescriptor>
fun CompilerContext.syntheticMemberFunctions(receiverTypes: Collection<KotlinType>): List<SimpleFunctionDescriptor>
transformFile fun <K : KtElement> CompilerContext.transformFile(ktFile: KtFile, mutations: List<Transform<K>>, match: K.() -> Boolean): List<KtFile>
unresolvedGivenCallSite fun CompilerContext.unresolvedGivenCallSite(call: ResolvedCall<*>): Pair<List<ValueParameterDescriptor>, List<TypeParameterDescriptor>>
updateFile fun <K : KtElement> CompilerContext.updateFile(mutations: List<Transform<K>>, file: KtFile, match: K.() -> Boolean): List<KtFile>
updateFiles fun <K : KtElement> CompilerContext.updateFiles(result: ArrayList<KtFile>, fileMutations: List<Pair<KtFile, List<Transform<K>>>>, match: K.() -> Boolean): Unit
validateConstructorCall fun CompilerContext.validateConstructorCall(call: ResolvedCall<*>): Validation

Do you like Arrow?

Arrow Org
<