diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotated.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotated.kt index 3cfd551f8a..d8b50df30f 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotated.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotated.kt @@ -16,13 +16,9 @@ */ package com.google.devtools.ksp.symbol -/** - * A symbol that can be annotated with annotations. - */ +/** A symbol that can be annotated with annotations. */ interface KSAnnotated : KSNode { - /** - * All annotations on this symbol. - */ + /** All annotations on this symbol. */ val annotations: Sequence } diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotation.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotation.kt index d65656c8cc..58b5c54b5e 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotation.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSAnnotation.kt @@ -16,34 +16,31 @@ */ package com.google.devtools.ksp.symbol -/** - * Instance of a constructor-call-like annotation. - */ +/** Instance of a constructor-call-like annotation. */ interface KSAnnotation : KSNode { - /** - * Reference to the type of the annotation class declaration. - */ + /** Reference to the type of the annotation class declaration. */ val annotationType: KSTypeReference /** - * The arguments applied to the constructor call to construct this annotation. - * Must be compile time constants. + * The arguments applied to the constructor call to construct this annotation. Must be compile + * time constants. + * * @see [KSValueArgument] for operations on its values. */ val arguments: List - /** - * The default values of the annotation members - */ + /** The default values of the annotation members */ val defaultArguments: List /** - * Short name for this annotation, equivalent to the simple name of the declaration of the annotation class. + * Short name for this annotation, equivalent to the simple name of the declaration of the + * annotation class. */ val shortName: KSName /** - * Use site target of the annotation. Could be null if no annotation use site target is specified. + * Use site target of the annotation. Could be null if no annotation use site target is + * specified. */ val useSiteTarget: AnnotationUseSiteTarget? } diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSCallableReference.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSCallableReference.kt index 7249b3bd4a..22d3d9ded1 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSCallableReference.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSCallableReference.kt @@ -16,23 +16,15 @@ */ package com.google.devtools.ksp.symbol -/** - * A reference to a callable entity, such as a function or a property. - */ +/** A reference to a callable entity, such as a function or a property. */ interface KSCallableReference : KSReferenceElement { - /** - * A reference to the type of its receiver. - */ + /** A reference to the type of its receiver. */ val receiverType: KSTypeReference? - /** - * Parameters to this callable. - */ + /** Parameters to this callable. */ val functionParameters: List - /** - * A reference to its return type. - */ + /** A reference to its return type. */ val returnType: KSTypeReference override fun accept(visitor: KSVisitor, data: D): R { diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassDeclaration.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassDeclaration.kt index d7de9eb723..f7033e6700 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassDeclaration.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassDeclaration.kt @@ -16,18 +16,15 @@ */ package com.google.devtools.ksp.symbol -/** - * Models class-like declarations, including class, interface and object. - */ +/** Models class-like declarations, including class, interface and object. */ interface KSClassDeclaration : KSDeclaration, KSDeclarationContainer { - /** - * The Kind of the class declaration. - */ + /** The Kind of the class declaration. */ val classKind: ClassKind /** - * Primary constructor of a class, secondary constructors can be obtained by filtering [declarations]. + * Primary constructor of a class, secondary constructors can be obtained by filtering + * [declarations]. */ val primaryConstructor: KSFunctionDeclaration? @@ -38,39 +35,48 @@ interface KSClassDeclaration : KSDeclaration, KSDeclarationContainer { /** * Determine whether this class declaration is a companion object. - * @see [https://kotlinlang.org/docs/tutorials/kotlin-for-py/objects-and-companion-objects.html#companion-objects] + * + * @see + * [https://kotlinlang.org/docs/tutorials/kotlin-for-py/objects-and-companion-objects.html#companion-objects] */ val isCompanionObject: Boolean /** - * @return a sequence of sealed subclasses of this class, if any. - * Calling [getSealedSubclasses] requires type resolution which is expensive and should be avoided if possible. + * @return a sequence of sealed subclasses of this class, if any. Calling [getSealedSubclasses] + * requires type resolution which is expensive and should be avoided if possible. */ fun getSealedSubclasses(): Sequence /** * Get all member functions of a class declaration, including declared and inherited. - * @return Sequence of function declarations from the class members. - * Calling [getAllFunctions] requires type resolution which is expensive and should be avoided if possible. + * + * @return Sequence of function declarations from the class members. Calling [getAllFunctions] + * requires type resolution which is expensive and should be avoided if possible. */ fun getAllFunctions(): Sequence /** * Get all member properties of a class declaration, including declared and inherited. - * @return Sequence of properties declarations from the class members. - * Calling [getAllProperties] requires type resolution which is expensive and should be avoided if possible. + * + * @return Sequence of properties declarations from the class members. Calling + * [getAllProperties] requires type resolution which is expensive and should be avoided if + * possible. */ fun getAllProperties(): Sequence /** * Create a type by applying a list of type arguments to this class' type parameters. + * * @param typeArguments List of Type arguments to be applied. - * @return A type constructed from this class declaration with type parameters substituted with the type arguments. + * @return A type constructed from this class declaration with type parameters substituted with + * the type arguments. */ fun asType(typeArguments: List): KSType /** - * If this is a generic class, return the type where the type argument is applied with star projection at use-site. + * If this is a generic class, return the type where the type argument is applied with star + * projection at use-site. + * * @return A type with all type parameters applied with star projection. */ fun asStarProjectedType(): KSType diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassifierReference.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassifierReference.kt index a9748e8141..ceaef2e7d9 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassifierReference.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSClassifierReference.kt @@ -16,18 +16,14 @@ */ package com.google.devtools.ksp.symbol -/** - * An application / reference to a user declared type such as class, interface and object. - */ +/** An application / reference to a user declared type such as class, interface and object. */ interface KSClassifierReference : KSReferenceElement { - /** - * The outer class of an inner class. - */ + /** The outer class of an inner class. */ val qualifier: KSClassifierReference? /** - * The text which appears in the reference. For example, it is "Int" in `val temperature: Int` or - * "kotlin.Any" in `val canBeAnything: kotlin.Any` + * The text which appears in the reference. For example, it is "Int" in `val temperature: Int` + * or "kotlin.Any" in `val canBeAnything: kotlin.Any` */ fun referencedName(): String diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclaration.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclaration.kt index 6d71e13266..fd11e869b9 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclaration.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclaration.kt @@ -17,42 +17,38 @@ package com.google.devtools.ksp.symbol /** - * A declaration, can be function declaration, class declaration and property declaration, or a type alias. + * A declaration, can be function declaration, class declaration and property declaration, or a type + * alias. */ interface KSDeclaration : KSModifierListOwner, KSAnnotated, KSExpectActual { - /** - * Simple name of this declaration, usually the name identifier at the declaration site. - */ + /** Simple name of this declaration, usually the name identifier at the declaration site. */ val simpleName: KSName /** - * Fully qualified name of this declaration, might not exist for some declarations like local declarations. + * Fully qualified name of this declaration, might not exist for some declarations like local + * declarations. */ val qualifiedName: KSName? - /** - * List of [type parameters][KSTypeParameter] of the declaration. - */ + /** List of [type parameters][KSTypeParameter] of the declaration. */ val typeParameters: List - /** - * The name of the package at which this declaration is declared. - */ + /** The name of the package at which this declaration is declared. */ val packageName: KSName /** - * Parent declaration of this declaration, i.e. the declaration that directly contains this declaration. - * File is not a declaration, so this property will be null for top level declarations. + * Parent declaration of this declaration, i.e. the declaration that directly contains this + * declaration. File is not a declaration, so this property will be null for top level + * declarations. */ val parentDeclaration: KSDeclaration? /** - * The containing source file of this declaration, can be null if symbol does not come from a source file, i.e. from a class file. + * The containing source file of this declaration, can be null if symbol does not come from a + * source file, i.e. from a class file. */ val containingFile: KSFile? - /** - * The doc string enclosed by \/\*\* and \*\/ - */ + /** The doc string enclosed by \/\*\* and \*\/ */ val docString: String? } diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclarationContainer.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclarationContainer.kt index e9844df31b..e861937752 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclarationContainer.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDeclarationContainer.kt @@ -16,12 +16,8 @@ */ package com.google.devtools.ksp.symbol -/** - * A declaration container can have a list of declarations declared in it. - */ +/** A declaration container can have a list of declarations declared in it. */ interface KSDeclarationContainer : KSNode { - /** - * Declarations that are lexically declared inside the current container. - */ + /** Declarations that are lexically declared inside the current container. */ val declarations: Sequence } diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDefNonNullReference.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDefNonNullReference.kt index 6230fe6a33..0bf75b58fb 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDefNonNullReference.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDefNonNullReference.kt @@ -2,8 +2,8 @@ package com.google.devtools.ksp.symbol interface KSDefNonNullReference : KSReferenceElement { /** - * Enclosed reference element of the Definitely non null type. - * For a reference of `T & Any`, this returns `T`. + * Enclosed reference element of the Definitely non null type. For a reference of `T & Any`, + * this returns `T`. */ val enclosedType: KSClassifierReference diff --git a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDynamicReference.kt b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDynamicReference.kt index 7902b09ed8..94b55e862c 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDynamicReference.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/symbol/KSDynamicReference.kt @@ -16,7 +16,5 @@ */ package com.google.devtools.ksp.symbol -/** - * Models `dynamic` type for Kotlin/JS. - */ +/** Models `dynamic` type for Kotlin/JS. */ interface KSDynamicReference : KSReferenceElement