有没有办法在 KDoc 的 @sample 中使用带有反引号名称的函数?
比如有一个类
class StandardAccount @JvmOverloads constructor(
override val address: Felt,
private val signer: Signer,
private val provider: Provider,
override val chainId: StarknetChainId,
private val cairoVersion: CairoVersion = CairoVersion.ONE,
) : Account {
/**
* @param address the address of the account contract
* @param privateKey a private key used to create a signer
* @param provider a provider used to interact with Starknet
* @param chainId the chain id of the Starknet network
* @param cairoVersion the version of Cairo language in which account contract is written
*
* Example usage:
* @sample starknet.account.StandardAccountTest.`creating account with private key`
*/
@JvmOverloads
constructor(
address: Felt,
privateKey: Felt,
provider: Provider,
chainId: StarknetChainId,
cairoVersion: CairoVersion = CairoVersion.ONE,
) : this(
address = address,
signer = StarkCurveSigner(privateKey),
provider = provider,
chainId = chainId,
cairoVersion = cairoVersion,
)
...
还有测试班
class StandardAccountTest {
...
@Test
fun `creating account with private key`() {
val privateKey = Felt(1234)
StandardAccount(Felt.ZERO, privateKey, provider, chainId)
}
...
所以最终我想像这样使用它
@sample starknet.account.StandardAccountTest.`creating account with private key`
不幸的是,我在 kotlin 文档中找不到这是否可行。 Github 上存在现有问题 https://github.com/Kotlin/dokka/issues/373 但我在 1.4.0-rc 变更日志中找不到解决方案。
最好在 Cairo Gang Telegram 群 询问有关 Cairo/Starknet 开发的任何信息。或者您可以加入 Starknet Discord 官方服务器以获得技术支持:https://discord.com/invite/starknet-community。