//arrow-meta/arrow.meta.dsl.resolve/ResolveSyntax

ResolveSyntax

interface ResolveSyntax

The Resolve phase is in charge of providing the meaning of the Kotlin Language to the structured trees discovered by the Kotlin parser. Right up until Analysis, we are just working with a tree structure—the AST. In resolution, we proceed to type-check the AST and all its expressions, associating each of them to a DeclarationDescriptor. A DeclarationDescriptor is a model that contains the type and Kotlin structure, as it understands our sources in the AST.

Inheritors

 
MetaPluginSyntax

Functions

Name Summary
declarationAttributeAlterer [jvm]
open fun declarationAttributeAlterer(refineDeclarationModality: CompilerContext.(modifierListOwner: KtModifierListOwner, declaration: DeclarationDescriptor?, containingDeclaration: DeclarationDescriptor?, currentModality: Modality, bindingContext: BindingContext, isImplicitModality: Boolean) -> Modality?): DeclarationAttributeAlterer
packageFragmentProvider [jvm]
open fun packageFragmentProvider(getPackageFragmentProvider: CompilerContext.(project: Project, module: ModuleDescriptor, storageManager: StorageManager, trace: BindingTrace, moduleInfo: ModuleInfo?, lookupTracker: LookupTracker) -> PackageFragmentProvider?): PackageProvider
The packageFragmentProvider function allows us to provide synthetic descriptors for declarations of a PackageFragmentDescriptor. A PackageFragmentDescriptor holds all the information about declared members in a package fragment such as top level typealiases, functions, properties, and class-like constructs such as object and interface.
syntheticResolver [jvm]
open fun syntheticResolver(addSyntheticSupertypes: CompilerContext.(thisDescriptor: ClassDescriptor, supertypes: MutableList<KotlinType>) -> Unit = Noop.effect3, generatePackageSyntheticClasses: CompilerContext.(thisDescriptor: PackageFragmentDescriptor, name: Name, ctx: LazyClassContext, declarationProvider: PackageMemberDeclarationProvider, result: MutableSet<ClassDescriptor>) -> Unit = Noop.effect6, generateSyntheticClasses: CompilerContext.(thisDescriptor: ClassDescriptor, name: Name, ctx: LazyClassContext, declarationProvider: ClassMemberDeclarationProvider, result: MutableSet<ClassDescriptor>) -> Unit = Noop.effect6, generateSyntheticMethods: CompilerContext.(thisDescriptor: ClassDescriptor, name: Name, bindingContext: BindingContext, fromSupertypes: List<SimpleFunctionDescriptor>, result: MutableCollection<SimpleFunctionDescriptor>) -> Unit = Noop.effect6, generateSyntheticProperties: CompilerContext.(thisDescriptor: ClassDescriptor, name: Name, bindingContext: BindingContext, ArrayList<PropertyDescriptor>, result: MutableSet<PropertyDescriptor>) -> Unit = Noop.effect6, generateSyntheticSecondaryConstructors: CompilerContext.(thisDescriptor: ClassDescriptor, bindingContext: BindingContext, result: MutableCollection<ClassConstructorDescriptor>) -> Unit = Noop.effect4, getSyntheticCompanionObjectNameIfNeeded: CompilerContext.(thisDescriptor: ClassDescriptor) -> Name? = Noop.nullable2(), getSyntheticFunctionNames: CompilerContext.(thisDescriptor: ClassDescriptor) -> List<Name>? = Noop.nullable2(), getSyntheticNestedClassNames: CompilerContext.(thisDescriptor: ClassDescriptor) -> List<Name>? = Noop.nullable2()): SyntheticResolver
The syntheticResolver extension allows the user to change the top level class and nested class descriptors requested by IntelliJ and some parts of the CLI compiler. This interface will be incomplete if your plugin is producing top level declarations that are typealiases, functions, or properties. For the above cases, we would need to combine it or entirely replace it with a packageFragmentProvider that can provide descriptors for those top level declarations.
syntheticScopes [jvm]
open fun syntheticScopes(syntheticConstructor: CompilerContext.(constructor: ConstructorDescriptor) -> ConstructorDescriptor? = Noop.nullable2(), syntheticConstructors: CompilerContext.(classifierDescriptors: Collection<DeclarationDescriptor>) -> Collection<FunctionDescriptor> = Noop.emptyCollection2(), syntheticConstructorsForName: CompilerContext.(contributedClassifier: ClassifierDescriptor, location: LookupLocation) -> Collection<FunctionDescriptor> = Noop.emptyCollection3(), syntheticExtensionProperties: CompilerContext.(receiverTypes: Collection<KotlinType>, location: LookupLocation) -> Collection<PropertyDescriptor> = Noop.emptyCollection3(), syntheticExtensionPropertiesForName: CompilerContext.(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation) -> Collection<PropertyDescriptor> = Noop.emptyCollection4(), syntheticMemberFunctions: CompilerContext.(receiverTypes: Collection<KotlinType>) -> Collection<FunctionDescriptor> = Noop.emptyCollection2(), syntheticMemberFunctionsForName: CompilerContext.(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation) -> Collection<FunctionDescriptor> = Noop.emptyCollection4(), syntheticStaticFunctions: CompilerContext.(functionDescriptors: Collection<DeclarationDescriptor>) -> Collection<FunctionDescriptor> = Noop.emptyCollection2(), syntheticStaticFunctionsForName: CompilerContext.(contributedFunctions: Collection<FunctionDescriptor>, location: LookupLocation) -> Collection<FunctionDescriptor> = Noop.emptyCollection3()): ExtensionPhase
The syntheticScopes function encapsulates a powerful interface that lets you peak and modify the resolution scope of constructors, extension functions, properties, and static functions. Altering the synthetic scope, we can provide our own descriptors to IntelliJ. These descriptors are required for IntelliJ IDEA to enable synthetic generated code required by IDE features such as autocompletion and code refactoring.

Do you like Arrow?

Arrow Org
<