From 1115823871eee2746001ee0889a927596db2ec98 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 16 Oct 2026 22:07:13 +0400 Subject: [PATCH] fix(coverage): open a covering test without calling the override-only navigate 2026.3 marks Navigatable.navigate(boolean) @ApiStatus.OverrideOnly, so verifyPlugin against IU-263 fails on its one call. PsiNavigateUtil is public and unannotated on 252, 262, OpenIDE and 2026.3; NavigationService.requestNavigate does not exist before 2026.3. Assisted-By: Claude Opus 5.5 --- .../testo/coverage/perTest/TestoTestIdentityMapper.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/github/xepozz/testo/coverage/perTest/TestoTestIdentityMapper.kt b/src/main/kotlin/com/github/xepozz/testo/coverage/perTest/TestoTestIdentityMapper.kt index 3d3ca86d..cb5ae9da 100644 --- a/src/main/kotlin/com/github/xepozz/testo/coverage/perTest/TestoTestIdentityMapper.kt +++ b/src/main/kotlin/com/github/xepozz/testo/coverage/perTest/TestoTestIdentityMapper.kt @@ -8,6 +8,7 @@ import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.ReadAction import com.intellij.openapi.project.Project import com.intellij.pom.Navigatable +import com.intellij.util.PsiNavigateUtil import com.intellij.util.concurrency.AppExecutorUtil import com.intellij.psi.PsiElement @@ -32,12 +33,12 @@ interface TestoTestIdentityMapper { /** Opens [id]'s method. The class is looked up in the index, which the EDT may not read: off it, then back to navigate. */ fun navigateToTest(project: Project, id: TestId) { - ReadAction.nonBlocking { - (TestoTestIdentityMapper.getInstance().resolve(id, project) as? Navigatable)?.takeIf { it.canNavigate() } + ReadAction.nonBlocking { + TestoTestIdentityMapper.getInstance().resolve(id, project)?.takeIf { (it as? Navigatable)?.canNavigate() == true } } .inSmartMode(project) .expireWith(project) - .finishOnUiThread(ModalityState.defaultModalityState()) { it?.navigate(true) } + .finishOnUiThread(ModalityState.defaultModalityState()) { PsiNavigateUtil.navigate(it, true) } .submit(AppExecutorUtil.getAppExecutorService()) }