diff --git a/mirai-console/backend/mirai-console/src/extensions/SingletonExtensionSelector.kt b/mirai-console/backend/mirai-console/src/extensions/SingletonExtensionSelector.kt index a817ca434..72f66b6c6 100644 --- a/mirai-console/backend/mirai-console/src/extensions/SingletonExtensionSelector.kt +++ b/mirai-console/backend/mirai-console/src/extensions/SingletonExtensionSelector.kt @@ -14,7 +14,7 @@ import net.mamoe.mirai.console.extension.AbstractExtensionPoint import net.mamoe.mirai.console.extension.Extension import net.mamoe.mirai.console.extension.FunctionExtension import net.mamoe.mirai.console.extension.SingletonExtension -import net.mamoe.mirai.console.internal.extension.BuiltInSingletonExtensionSelector +import net.mamoe.mirai.console.internal.extension.SingletonExtensionSelectorImpl import net.mamoe.mirai.console.internal.extension.ExtensionRegistry import net.mamoe.mirai.console.internal.extension.GlobalComponentStorage import net.mamoe.mirai.console.plugin.Plugin @@ -55,7 +55,7 @@ public interface SingletonExtensionSelector : FunctionExtension { check(instanceField == null) { "Internal error: reinitialize SingletonExtensionSelector" } val instances = GlobalComponentStorage.run { SingletonExtensionSelector.getExtensions() } instanceField = when { - instances.isEmpty() -> BuiltInSingletonExtensionSelector + instances.isEmpty() -> SingletonExtensionSelectorImpl instances.size == 1 -> { instances.single().also { (plugin, ext) -> MiraiConsole.mainLogger.info { "Loaded SingletonExtensionSelector: $ext from ${plugin?.name ?: ""}" } diff --git a/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt b/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt index 760a247f9..02910c1bf 100644 --- a/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt +++ b/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt @@ -32,7 +32,7 @@ import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.Co import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.PasswordKind.MD5 import net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig.Account.PasswordKind.PLAIN import net.mamoe.mirai.console.internal.data.builtins.LoggerConfig -import net.mamoe.mirai.console.internal.extension.BuiltInSingletonExtensionSelector +import net.mamoe.mirai.console.internal.extension.SingletonExtensionSelectorImpl import net.mamoe.mirai.console.internal.extension.GlobalComponentStorage import net.mamoe.mirai.console.internal.logging.LoggerControllerImpl import net.mamoe.mirai.console.internal.logging.MiraiConsoleLogger @@ -164,7 +164,7 @@ internal object MiraiConsoleImplementationBridge : CoroutineScope, phase("load SingletonExtensionSelector") { SingletonExtensionSelector.init() val instance = SingletonExtensionSelector.instance - if (instance is BuiltInSingletonExtensionSelector) { + if (instance is SingletonExtensionSelectorImpl) { consoleDataScope.addAndReloadConfig(instance.config) } } diff --git a/mirai-console/backend/mirai-console/src/internal/extension/BuiltInSingletonExtensionSelector.kt b/mirai-console/backend/mirai-console/src/internal/extension/SingletonExtensionSelectorImpl.kt similarity index 97% rename from mirai-console/backend/mirai-console/src/internal/extension/BuiltInSingletonExtensionSelector.kt rename to mirai-console/backend/mirai-console/src/internal/extension/SingletonExtensionSelectorImpl.kt index eecaf0f72..0714840a7 100644 --- a/mirai-console/backend/mirai-console/src/internal/extension/BuiltInSingletonExtensionSelector.kt +++ b/mirai-console/backend/mirai-console/src/internal/extension/SingletonExtensionSelectorImpl.kt @@ -21,7 +21,7 @@ import net.mamoe.mirai.console.util.ConsoleInput import net.mamoe.mirai.utils.info import kotlin.reflect.KClass -internal object BuiltInSingletonExtensionSelector : SingletonExtensionSelector { +internal object SingletonExtensionSelectorImpl : SingletonExtensionSelector { internal val config: SaveData = SaveData()