[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
This commit is contained in:
Konstantin Hudyakov
2026-03-02 18:55:49 +00:00
committed by intellij-monorepo-bot
parent 95ba70f1b4
commit 41f38616a4
@@ -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 {