[IFT] Remove mentioning line from the Run-to-Cursor task in the Debug lesson

It is not supported in the new UI now

IJ-CR-103403

GitOrigin-RevId: 788a9218796e8cf2d40c1a0261b95cb2ab1f52ff
This commit is contained in:
Alexey Merkulov
2023-02-24 15:00:43 +00:00
committed by intellij-monorepo-bot
parent acb4ad0ae8
commit a9fa41a46a
2 changed files with 1 additions and 32 deletions
@@ -395,7 +395,6 @@ debug.workflow.mute.breakpoints=Oops, the same breakpoint again. Now we don''t n
debug.workflow.run.to.cursor.intro=Let''s check the result of {0}. We''ve moved the editor cursor to the {1} statement.
debug.workflow.run.to.cursor.press=Press {0}.
debug.workflow.run.to.cursor.press.or.click=Press {0} or click {1}.
debug.workflow.run.to.cursor.alternative=Alternatively, click the line number. Note that {0} works even if breakpoints are muted.
debug.workflow.evaluate.expression=It seems that the exception is thrown as the result of the selected function call. Let's evaluate it to check the guess. \
Copy the selected expression and paste it into the highlighted text field.
debug.workflow.evaluate.it=Press {0} to evaluate the expression.
@@ -7,13 +7,10 @@ import com.intellij.execution.ui.UIExperiment
import com.intellij.icons.AllIcons
import com.intellij.ide.ui.text.ShortcutsRenderingUtil
import com.intellij.idea.ActionsBundle
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.DataProvider
import com.intellij.openapi.actionSystem.impl.ActionButton
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.editor.LogicalPosition
import com.intellij.openapi.editor.ex.EditorGutterComponentEx
import com.intellij.openapi.editor.impl.EditorComponentImpl
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.psi.PsiDocumentManager
@@ -42,8 +39,6 @@ import training.statistic.LessonStartingWay
import training.ui.LearningUiHighlightingManager
import training.ui.LearningUiUtil.findComponentWithTimeout
import training.util.WeakReferenceDelegator
import training.util.getActionById
import java.awt.Rectangle
import java.awt.event.KeyEvent
abstract class CommonDebugLesson(id: String) : KLesson(id, LessonsBundle.message("debug.workflow.lesson.name")) {
@@ -322,19 +317,6 @@ abstract class CommonDebugLesson(id: String) : KLesson(id, LessonsBundle.message
val position = sample.getPosition(3)
caret(position)
highlightLineNumberByOffset(position.startOffset)
task {
if (!UIExperiment.isNewDebuggerUIEnabled()) {
val runToCursorAction = getActionById("RunToCursor")
triggerAndFullHighlight {
usePulsation = true
clearPreviousHighlights = false
}.component { ui: ActionButton ->
ui.action == runToCursorAction && LessonUtil.checkToolbarIsShowing(ui)
}
}
}
actionTask("RunToCursor") {
proposeRestore {
checkPositionOfEditor(LessonSample(afterFixText, position))
@@ -344,8 +326,7 @@ abstract class CommonDebugLesson(id: String) : KLesson(id, LessonsBundle.message
LessonsBundle.message("debug.workflow.run.to.cursor.press.or.click", action(it), icon(AllIcons.Actions.RunToCursor))
}
else LessonsBundle.message("debug.workflow.run.to.cursor.press", action(it))
val alternative = LessonsBundle.message("debug.workflow.run.to.cursor.alternative", LessonUtil.actionName(it))
"$intro $actionPart $alternative"
"$intro $actionPart"
}
}
@@ -403,17 +384,6 @@ abstract class CommonDebugLesson(id: String) : KLesson(id, LessonsBundle.message
protected open fun LessonContext.restoreHotSwapStateInformer() = Unit
private fun LessonContext.highlightLineNumberByOffset(offset: Int) {
task {
triggerAndBorderHighlight().componentPart l@{ ui: EditorGutterComponentEx ->
if (CommonDataKeys.EDITOR.getData(ui as DataProvider) != editor) return@l null
val line = editor.offsetToVisualLine(offset, true)
val y = editor.visualLineToY(line)
return@l Rectangle(2, y, ui.iconsAreaWidth + 6, editor.lineHeight)
}
}
}
private fun LessonContext.quickEvaluateTask(positionId: Int, textAndRestore: TaskContext.(LessonSamplePosition) -> Unit) {
task("QuickEvaluateExpression") {
before {