Package-level declarations

Types

Link copied to clipboard

This marks any code reference that can be annotated, such as a ClassReference or MemberFunctionReference.

Link copied to clipboard
Link copied to clipboard
sealed class AnnotationReference

Used to create a common type between KtAnnotationEntry class references and AnnotationDescriptor references, to streamline parsing.

Link copied to clipboard
interface AnvilModuleDescriptor : ModuleDescriptor
Link copied to clipboard

Used to create a common type between KtClassOrObject class references and ClassDescriptor references, to streamline parsing.

Link copied to clipboard
sealed interface FunctionReference
Link copied to clipboard

Used to create a common type between KtNamedFunction class references and FunctionDescriptor references, to streamline parsing.

Link copied to clipboard
Link copied to clipboard
sealed interface PropertyReference
Link copied to clipboard
Link copied to clipboard
sealed class TypeReference
Link copied to clipboard

Functions

Link copied to clipboard

This will return all super types as ClassReference, whether they're parsed as KtClassOrObject or ClassDescriptor. This will include generated code, assuming it has already been generated. The returned sequence will be distinct by FqName, and Psi types are preferred over Descriptors.

fun AnvilCompilationExceptionAnnotationReference(annotationReference: AnnotationReference, message: String, cause: Throwable? = null): AnvilCompilationException
Link copied to clipboard
fun AnvilCompilationExceptionClassReference(classReference: ClassReference, message: String, cause: Throwable? = null): AnvilCompilationException
fun AnvilCompilationExceptionFunctionReference(functionReference: FunctionReference, message: String, cause: Throwable? = null): AnvilCompilationException
fun AnvilCompilationExceptionParameterReference(parameterReference: ParameterReference, message: String, cause: Throwable? = null): AnvilCompilationException
fun AnvilCompilationExceptionPropertyReference(propertyReference: PropertyReference, message: String, cause: Throwable? = null): AnvilCompilationException
Link copied to clipboard
fun AnvilCompilationExceptionTypReference(typeReference: TypeReference, message: String, cause: Throwable? = null): AnvilCompilationException
Link copied to clipboard
Link copied to clipboard
fun ClassName.asClassId(local: Boolean = false): ClassId
Link copied to clipboard
fun ClassReference.asClassName(): ClassName
Link copied to clipboard
fun ClassReference.asTypeName(): TypeName
Link copied to clipboard
fun FqName.canResolveFqName(module: ModuleDescriptor): Boolean
Link copied to clipboard
fun Collection<KtFile>.classAndInnerClassReferences(module: ModuleDescriptor): Sequence<ClassReference.Psi>
Link copied to clipboard
fun ClassReference.generateClassName(separator: String = "_", suffix: String = ""): ClassId
fun ClassName.generateClassName(separator: String = "_", suffix: String = ""): ClassName
Link copied to clipboard
fun ClassName.generateClassNameString(separator: String = "", suffix: String = "", capitalizePackage: Boolean = true): String
Link copied to clipboard
Link copied to clipboard
fun AnnotationDescriptor.toAnnotationReference(declaringClass: ClassReference.Descriptor?, module: ModuleDescriptor): AnnotationReference.Descriptor
fun KtAnnotationEntry.toAnnotationReference(declaringClass: ClassReference.Psi?, module: ModuleDescriptor): AnnotationReference.Psi
Link copied to clipboard
fun ClassDescriptor.toClassReference(module: ModuleDescriptor): ClassReference.Descriptor
fun FqName.toClassReference(module: ModuleDescriptor): ClassReference
fun KtClassOrObject.toClassReference(module: ModuleDescriptor): ClassReference.Psi
Link copied to clipboard
fun FqName.toClassReferenceOrNull(module: ModuleDescriptor): ClassReference?

Attempts to find the KtClassOrObject for the FqName first, then falls back to the ClassDescriptor if the Psi element cannot be found. This will happen if the class for FqName is not part of this compilation unit.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun KtTypeReference.toTypeReference(declaringClass: ClassReference.Psi?, module: AnvilModuleDescriptor): TypeReference.Psi