From 41f38616a4fdd9860b294ee98aba0fc5687625ab Mon Sep 17 00:00:00 2001 From: Konstantin Hudyakov Date: Wed, 25 Feb 2026 18:37:06 +0200 Subject: [PATCH] [IFT] IJPL-221468 Adapt Search for Actions lesson for New SE Have to use hacky matching by item text because we can't directly reference the item class here. (cherry picked from commit df7ea4f236cede6085ac42c907b11e6903567b22) IJ-CR-193450 GitOrigin-RevId: 4e0dc05bfb12d094c69e3c7c8ad0d9518a4c0a48 --- .../training/learn/lesson/general/GotoActionLesson.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/ide-features-trainer/src/training/learn/lesson/general/GotoActionLesson.kt b/plugins/ide-features-trainer/src/training/learn/lesson/general/GotoActionLesson.kt index a335e32a1398..cce13c3dad8d 100644 --- a/plugins/ide-features-trainer/src/training/learn/lesson/general/GotoActionLesson.kt +++ b/plugins/ide-features-trainer/src/training/learn/lesson/general/GotoActionLesson.kt @@ -3,11 +3,10 @@ package training.learn.lesson.general import com.intellij.ide.IdeBundle import com.intellij.ide.actions.searcheverywhere.SearchEverywhereUI -import com.intellij.ide.util.gotoByName.GotoActionModel import com.intellij.idea.ActionsBundle +import com.intellij.openapi.actionSystem.ActionManager import com.intellij.openapi.application.ApplicationNamesInfo import com.intellij.openapi.client.ClientSystemInfo -import com.intellij.openapi.editor.actions.ToggleShowLineNumbersGloballyAction import com.intellij.openapi.editor.impl.EditorComponentImpl import training.dsl.EditorSettingsState.isLineNumbersShown import training.dsl.LessonContext @@ -82,11 +81,10 @@ class GotoActionLesson(private val sample: LessonSample, task { val prefix = LearnBundle.message("show.line.number.prefix.to.show.first") text(LessonsBundle.message("goto.action.show.line.numbers.request", strong(prefix), strong(showLineNumbersName))) + val actionPresentation = ActionManager.getInstance().getAction("EditorGutterToggleGlobalLineNumbers").templatePresentation + val actionText = "${actionPresentation.text} (${actionPresentation.description})" triggerAndBorderHighlight().listItem { item -> - val matchedValue = item as? GotoActionModel.MatchedValue - val actionWrapper = matchedValue?.value as? GotoActionModel.ActionWrapper - val action = actionWrapper?.action - action is ToggleShowLineNumbersGloballyAction + item.isToStringContains(actionText) } restoreState { !checkInsideSearchEverywhere() } test {