diff --git a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt index a117366d7..721ceac44 100644 --- a/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt +++ b/src/main/kotlin/platform/mixin/inspection/injector/InvalidInjectorMethodSignatureInspection.kt @@ -128,10 +128,12 @@ class InvalidInjectorMethodSignatureInspection : MixinInspection() { if (possibleSignatures.isEmpty()) { reportedSignature = true - holder.registerProblem( - parameters, - "There are no possible signatures for this injector", - ) + if (handler.isUnresolved(annotation) != null) { + holder.registerProblem( + parameters, + "There are no possible signatures for this injector", + ) + } continue } diff --git a/src/main/kotlin/platform/mixin/reference/target/TargetReference.kt b/src/main/kotlin/platform/mixin/reference/target/TargetReference.kt index 4ff7e113d..9a8eb4f72 100644 --- a/src/main/kotlin/platform/mixin/reference/target/TargetReference.kt +++ b/src/main/kotlin/platform/mixin/reference/target/TargetReference.kt @@ -20,6 +20,7 @@ package com.demonwav.mcdev.platform.mixin.reference.target +import com.demonwav.mcdev.platform.mixin.handlers.InjectorAnnotationHandler import com.demonwav.mcdev.platform.mixin.handlers.MixinAnnotationHandler import com.demonwav.mcdev.platform.mixin.handlers.injectionPoint.AtResolver import com.demonwav.mcdev.platform.mixin.reference.MixinReference @@ -71,9 +72,13 @@ object TargetReference : PolyReferenceResolver(), MixinReference { private fun getTargets(at: PsiAnnotation, forUnresolved: Boolean): List? { val (handler, annotation) = generateSequence(at.parent) { it.parent } .filterIsInstance() + .flatMap { it.owner?.annotations?.asSequence() ?: emptySequence() } .mapNotNull { annotation -> val qName = annotation.qualifiedName ?: return@mapNotNull null - MixinAnnotationHandler.forMixinAnnotation(qName, annotation.project)?.let { it to annotation } + ( + MixinAnnotationHandler.forMixinAnnotation(qName, annotation.project) + as? InjectorAnnotationHandler + )?.let { it to annotation } }.firstOrNull() ?: return null if (forUnresolved && handler.isSoft) { return null