[IFT] IJPL-221468 Refactor: use other toString implementation for SeResultListItemRow

Also, had to make `SeTargetItemPresentationImpl` to make it implement `toString`.
Refactored logic in IFT to make it work with both new SE and the old one.


(cherry picked from commit 064677d3c08f74c3966aa66b5f0cee5b68459a42)

IJ-CR-193450

GitOrigin-RevId: 234d30730e2ac11db06aca54abfd7fa836be1e10
This commit is contained in:
Konstantin Hudyakov
2026-02-26 12:56:17 +02:00
committed by intellij-monorepo-bot
parent 861406cf58
commit 40abaa7658
5 changed files with 9 additions and 7 deletions

View File

@@ -327,7 +327,7 @@ abstract class CommonLogicForOnboardingTours(id: String, @Nls lessonName: String
}
text(JavaLessonsBundle.message("java.onboarding.search.everywhere.description",
code("AVERAGE"), code(JavaLessonsBundle.message("toggle.case.part"))))
val actionText = ActionManager.getInstance().getAction("EditorToggleCase").toString()
val actionText = ActionsBundle.actionText("EditorToggleCase")
triggerAndBorderHighlight().listItem { item ->
item.isToStringContains(actionText)
}

View File

@@ -10,7 +10,7 @@ sealed interface SeResultListRow
@Internal
class SeResultListItemRow(val item: SeItemData) : SeResultListRow {
override fun toString(): String {
return item.fetchItemIfExists()?.rawObject?.toString() ?: "SeResultListItemRow(item=$item)"
return "SeResultListItemRow(presentation=${item.presentation})"
}
}

View File

@@ -173,7 +173,7 @@ class SeTargetItemPresentationBuilder {
@Serializable
@ApiStatus.Internal
class SeTargetItemPresentationImpl internal constructor(
data class SeTargetItemPresentationImpl(
private val backgroundColorId: ColorId? = null,
private val iconId: IconId? = null,
val iconOriginalWidth: Int? = null,

View File

@@ -4,7 +4,6 @@ package training.learn.lesson.general
import com.intellij.ide.IdeBundle
import com.intellij.ide.actions.searcheverywhere.SearchEverywhereUI
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.impl.EditorComponentImpl
@@ -81,10 +80,13 @@ 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 actionText = ActionManager.getInstance().getAction("EditorGutterToggleGlobalLineNumbers").toString()
val localActionDescription = ActionsBundle.actionDescription("EditorToggleShowLineNumbers")
val globalActionText = ActionsBundle.actionText("EditorGutterToggleGlobalLineNumbers")
triggerAndBorderHighlight().listItem { item ->
item.isToStringContains(actionText)
item.isToStringContains(globalActionText) && !item.isToStringContains(localActionDescription)
}
restoreState { !checkInsideSearchEverywhere() }
test {
waitComponent(SearchEverywhereUI::class.java)

View File

@@ -546,7 +546,7 @@ class PythonOnboardingTourLesson :
}
text(PythonLessonsBundle.message("python.onboarding.search.everywhere.description",
code("AVERAGE"), code(PythonLessonsBundle.message("toggle.case.part"))))
val actionText = ActionManager.getInstance().getAction("EditorToggleCase").toString()
val actionText = ActionsBundle.actionText("EditorToggleCase")
triggerAndBorderHighlight().listItem { item ->
item.isToStringContains(actionText)
}