From 117fc789e0951f3501ac0b87924ae44242670ad2 Mon Sep 17 00:00:00 2001 From: RedNesto Date: Mon, 1 Jan 2024 02:09:29 +0100 Subject: [PATCH] Fix mixin target navigation --- .../platform/mixin/insight/MixinLineMarkerProvider.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/platform/mixin/insight/MixinLineMarkerProvider.kt b/src/main/kotlin/platform/mixin/insight/MixinLineMarkerProvider.kt index e8c844841..bf0ca8e7d 100644 --- a/src/main/kotlin/platform/mixin/insight/MixinLineMarkerProvider.kt +++ b/src/main/kotlin/platform/mixin/insight/MixinLineMarkerProvider.kt @@ -66,7 +66,13 @@ class MixinLineMarkerProvider : LineMarkerProviderDescriptor(), GutterIconNaviga val name = psiClass.name ?: return val targets = psiClass.mixinTargets .mapNotNull { it.findSourceClass(psiClass.project, psiClass.resolveScope, canDecompile = true) } - if (targets.isNotEmpty()) { + + val singleTarget = targets.singleOrNull() + if (singleTarget != null) { + if (singleTarget.canNavigate()) { + singleTarget.navigate(true) + } + } else if (targets.isNotEmpty()) { getPsiElementPopup(targets.toTypedArray(), "Choose target class of $name") .show(RelativePoint(e)) }