IFT-423 Do not proceed the run lesson if user ran current file configuration

This lesson is designed to show run configurations feature, so running the current file should take no effect.

IJ-CR-98349

GitOrigin-RevId: 3a5b084488e564c15919e7ecd8e9f4e91e2ac0ca
This commit is contained in:
Konstantin Hudyakov
2022-11-11 12:26:41 +02:00
committed by intellij-monorepo-bot
parent 17f732a92c
commit c3633782db
3 changed files with 3 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ class JavaRunConfigurationLesson : CommonRunConfigurationLesson("java.run.config
task("RunClass") {
text(JavaLessonsBundle.message("java.run.configuration.lets.run", icon(AllIcons.Actions.Execute), action(it),
strong(ExecutionBundle.message("default.runner.start.action.text").dropMnemonic())))
timerCheck { configurations().isNotEmpty() }
//Wait toolwindow
checkToolWindowState("Run", true)
test {

View File

@@ -19,7 +19,7 @@ abstract class CommonRunConfigurationLesson(id: String) : KLesson(id, LessonsBun
protected abstract val demoConfigurationName: String
private fun TaskRuntimeContext.runManager() = RunManager.getInstance(project)
private fun TaskRuntimeContext.configurations() =
protected fun TaskRuntimeContext.configurations() =
runManager().allSettings.filter { it.name.contains(demoConfigurationName) }
private fun TaskContext.runToolWindow() = strong(ExecutionBundle.message("tool.window.name.run"))

View File

@@ -15,6 +15,7 @@ class PythonRunConfigurationLesson : CommonRunConfigurationLesson("python.run.co
override fun LessonContext.runTask() {
task("RunClass") {
text(PythonLessonsBundle.message("python.run.configuration.lets.run", action(it)))
timerCheck { configurations().isNotEmpty() }
//Wait toolwindow
checkToolWindowState("Run", true)
test {