dev.mokkery.plugin.ir.FqName.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mokkery-plugin Show documentation
Show all versions of mokkery-plugin Show documentation
Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
The newest version!
package dev.mokkery.plugin.ir
import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import kotlin.properties.PropertyDelegateProvider
import kotlin.properties.ReadOnlyProperty
val fqName: PropertyDelegateProvider>
get() = PropertyDelegateProvider { _: Any?, property ->
val name = FqName(property.name.replace("_", "."))
ReadOnlyProperty { _, _ -> name }
}
val FqName.functionId: PropertyDelegateProvider>
get() = PropertyDelegateProvider { _: Any?, property ->
val id = CallableId(this, Name.identifier(property.name))
ReadOnlyProperty { _, _ -> id }
}
val FqName.fqName: PropertyDelegateProvider>
get() = PropertyDelegateProvider { _: Any?, property ->
val name = child(Name.identifier(property.name))
ReadOnlyProperty { _, _ -> name }
}