From a1c48b0ff43ca047e57914db5ffbbd092c62ec77 Mon Sep 17 00:00:00 2001 From: 7410 <85879080+O7410@users.noreply.github.com> Date: Sun, 4 Aug 2024 14:11:35 +0300 Subject: [PATCH] made "Method must not be static" error be on the static keyword instead of the method --- .../injector/InvalidInjectorMethodSignatureInspection.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt index bc168040a..4be5c9593 100644 --- a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt +++ b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt @@ -32,6 +32,7 @@ import com.demonwav.mcdev.platform.mixin.util.isAssignable import com.demonwav.mcdev.platform.mixin.util.isConstructor import com.demonwav.mcdev.platform.mixin.util.isMixinExtrasSugar import com.demonwav.mcdev.util.Parameter +import com.demonwav.mcdev.util.findKeyword import com.demonwav.mcdev.util.fullQualifiedName import com.demonwav.mcdev.util.invokeLater import com.demonwav.mcdev.util.synchronize @@ -133,7 +134,7 @@ class InvalidInjectorMethodSignatureInspection : MixinInspection() { } else if (!shouldBeStatic && modifiers.hasModifierProperty(PsiModifier.STATIC)) { reportedStatic = true holder.registerProblem( - identifier, + modifiers.findKeyword(PsiModifier.STATIC) ?: identifier, "Method must not be static", QuickFixFactory.getInstance().createModifierListFix( modifiers,