diff --git a/tools/intellij-plugin/src/diagnostics/CommandDeclarationChecker.kt b/tools/intellij-plugin/src/diagnostics/CommandDeclarationChecker.kt index be26d1a98..6965c23f4 100644 --- a/tools/intellij-plugin/src/diagnostics/CommandDeclarationChecker.kt +++ b/tools/intellij-plugin/src/diagnostics/CommandDeclarationChecker.kt @@ -12,6 +12,8 @@ package net.mamoe.mirai.console.intellij.diagnostics import net.mamoe.mirai.console.compiler.common.diagnostics.MiraiConsoleErrors.ILLEGAL_COMMAND_DECLARATION_RECEIVER import net.mamoe.mirai.console.compiler.common.resolve.COMMAND_SENDER_FQ_NAME import net.mamoe.mirai.console.intellij.resolve.hasSuperType +import net.mamoe.mirai.console.intellij.resolve.isCompositeCommandSubCommand +import net.mamoe.mirai.console.intellij.resolve.isSimpleCommandHandler import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.diagnostics.Diagnostic import org.jetbrains.kotlin.psi.KtDeclaration @@ -23,16 +25,15 @@ class CommandDeclarationChecker : DeclarationChecker { override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) { if (declaration !is KtNamedFunction) return - // exclusive checks - // currently no checks -// when { -// declaration.isSimpleCommandHandler() -> { -// } -// -// declaration.isCompositeCommandSubCommand() -> { -// } -// else -> return -// } + // exclusive checks or return + when { + declaration.isSimpleCommandHandler() -> { + } + + declaration.isCompositeCommandSubCommand() -> { + } + else -> return + } // common checks checkCommandReceiverParameter(declaration)?.let { context.report(it) }