SourceUsage

@Serializable
data class SourceUsage(val kind: UsageKind, val targetFqName: String, val filePath: String, val line: Int, val column: Int, val enclosingFunction: String? = null, val enclosingClass: String? = null, val enclosingProperty: String? = null, val rawExpression: String = targetFqName, val sourceSets: List<SourceSetId> = emptyList(), val possibleTargetFqNames: List<String> = emptyList(), val unresolvedPossibleUsage: Boolean = false, val confidence: ResolutionConfidence = if (unresolvedPossibleUsage) { ResolutionConfidence.POSSIBLE } else { ResolutionConfidence.RESOLVED }, val sourceStartOffset: Int = -1, val sourceEndOffset: Int = -1, val enclosingFunctionStartOffset: Int = -1, val enclosingFunctionEndOffset: Int = -1)

A resolved (or conservatively possible) Kotlin source usage.

Constructors

Link copied to clipboard
constructor(kind: UsageKind, targetFqName: String, filePath: String, line: Int, column: Int, enclosingFunction: String? = null, enclosingClass: String? = null, enclosingProperty: String? = null, rawExpression: String = targetFqName, sourceSets: List<SourceSetId> = emptyList(), possibleTargetFqNames: List<String> = emptyList(), unresolvedPossibleUsage: Boolean = false, confidence: ResolutionConfidence = if (unresolvedPossibleUsage) { ResolutionConfidence.POSSIBLE } else { ResolutionConfidence.RESOLVED }, sourceStartOffset: Int = -1, sourceEndOffset: Int = -1, enclosingFunctionStartOffset: Int = -1, enclosingFunctionEndOffset: Int = -1)

Properties

Link copied to clipboard
val column: Int

Filter or assertion criteria for column.

Link copied to clipboard

Filter or assertion criteria for confidence.

Link copied to clipboard
val enclosingClass: String? = null

Filter or assertion criteria for enclosing class.

Link copied to clipboard

Filter or assertion criteria for enclosing function.

Link copied to clipboard

Filter or assertion criteria for enclosing function end offset.

Link copied to clipboard

Filter or assertion criteria for enclosing function start offset.

Link copied to clipboard

Filter or assertion criteria for enclosing property.

Link copied to clipboard

Filter or assertion criteria for file path.

Link copied to clipboard

Filter or assertion criteria for kind.

Link copied to clipboard
val line: Int

Filter or assertion criteria for line.

Link copied to clipboard

Filter or assertion criteria for possible target fq names.

Link copied to clipboard

Filter or assertion criteria for raw expression.

Link copied to clipboard

Filter or assertion criteria for source end offset.

Link copied to clipboard

Filter or assertion criteria for source sets.

Link copied to clipboard

Filter or assertion criteria for source start offset.

Link copied to clipboard

Filter or assertion criteria for target fq name.

Link copied to clipboard

Filter or assertion criteria for unresolved possible usage.

Functions

Link copied to clipboard
fun SourceUsage.isEnclosedInClass(classFqName: String, className: String? = null): Boolean

Returns true if this usage is enclosed in the class specified by classFqName and optional className.

Link copied to clipboard
fun SourceUsage.isEnclosedInProperty(propertyName: String, classFqName: String? = null, className: String? = null): Boolean

Returns true if this usage is enclosed in the property specified by propertyName and optional class contexts.