From 3b9414dc5065c3a257305dbe620a6cb28a64c367 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 12 Sep 2020 20:28:58 +0800 Subject: [PATCH] Fix typo --- .../plugin/jvm/JvmPluginDescription.kt | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/JvmPluginDescription.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/JvmPluginDescription.kt index 30f366424..738427b7e 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/JvmPluginDescription.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/JvmPluginDescription.kt @@ -34,10 +34,20 @@ public interface JvmPluginDescription : PluginDescription { */ @JvmSynthetic public operator fun invoke( - name: String, + /** + * @see [PluginDescription.id] + */ + id: String, + /** + * @see [PluginDescription.version] + */ version: String, - block: JvmPluginDescriptionBuilder.() -> Unit = {} - ): JvmPluginDescription = JvmPluginDescriptionBuilder(name, version).apply(block).build() + /** + * @see [PluginDescription.name] + */ + name: String = id, + block: JvmPluginDescriptionBuilder.() -> Unit = {}, + ): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build() /** * 构建 [JvmPluginDescription] @@ -45,10 +55,20 @@ public interface JvmPluginDescription : PluginDescription { */ @JvmSynthetic public operator fun invoke( - name: String, + /** + * @see [PluginDescription.id] + */ + id: String, + /** + * @see [PluginDescription.version] + */ version: Semver, - block: JvmPluginDescriptionBuilder.() -> Unit = {} - ): JvmPluginDescription = JvmPluginDescriptionBuilder(name, version).apply(block).build() + /** + * @see [PluginDescription.name] + */ + name: String = id, + block: JvmPluginDescriptionBuilder.() -> Unit = {}, + ): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build() } }