bindToSource

fun MetamodelEntity.bindToSource(referenceName: String, declaringClassName: String)

Sets the canonical identifiers for an entity that was materialized from source (as opposed to being instantiated from compiled bytecode). Intended for use by PSI / source materializers such as the IDEA plugin.

  • referenceName is the Kotlin val name the entity is bound to in source.

  • declaringClassName is the fully-qualified name of the Kotlin file-facade class (e.g. com.x.y.FailuresKt for a top-level val in Failures.kt) or the enclosing class (for a class-member val).

After calling this, MetamodelEntity.declaringClassName returns declaringClassName and MetamodelEntity.id computes the canonical Kotlin-path identifier — without needing the compiled Class<*> instance, which is unavailable for source-only entities.

Generated with STIG