IJOB-26 Do now show Run and Debug lessons in Aqua

These lessons expect that `Current File` run configuration is available, but it is not enabled in Aqua.

GitOrigin-RevId: 0412925c501f3234444702c5f6657078e83d5f30
This commit is contained in:
Konstantin Hudyakov
2024-10-24 14:03:45 +03:00
committed by intellij-monorepo-bot
parent 54fb46a681
commit 513b928a78
2 changed files with 36 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.ift
import com.intellij.execution.actions.RunConfigurationsComboBoxAction
import com.intellij.java.ift.lesson.assistance.JavaEditorCodingAssistanceLesson
import com.intellij.java.ift.lesson.basic.JavaContextActionsLesson
import com.intellij.java.ift.lesson.basic.JavaSelectLesson
@@ -15,6 +16,7 @@ import com.intellij.java.ift.lesson.refactorings.JavaRenameLesson
import com.intellij.java.ift.lesson.run.JavaDebugLesson
import com.intellij.java.ift.lesson.run.JavaRunConfigurationLesson
import com.intellij.lang.java.JavaLanguage
import com.intellij.openapi.project.ProjectManager
import com.intellij.util.PlatformUtils
import training.dsl.LessonUtil
import training.learn.CourseManager
@@ -141,17 +143,21 @@ class JavaLearningCourse : LearningCourseBase(JavaLanguage.INSTANCE.id) {
JavaOccurrencesLesson(),
)
},
LearningModule(id = "Java.RunAndDebug",
name = LessonsBundle.message("run.debug.module.name"),
description = LessonsBundle.message("run.debug.module.description"),
primaryLanguage = langSupport,
moduleType = LessonType.SINGLE_EDITOR) {
listOf(
JavaRunConfigurationLesson(),
JavaDebugLesson(),
)
},
)
) + if (RunConfigurationsComboBoxAction.hasRunCurrentFileItem(ProjectManager.getInstance().defaultProject)) { // project doesn't matter in this check for us
listOf(
LearningModule(id = "Java.RunAndDebug",
name = LessonsBundle.message("run.debug.module.name"),
description = LessonsBundle.message("run.debug.module.description"),
primaryLanguage = langSupport,
moduleType = LessonType.SINGLE_EDITOR) {
listOf(
JavaRunConfigurationLesson(),
JavaDebugLesson(),
)
}
)
}
else emptyList()
override fun getLessonIdToTipsMap(): Map<String, List<String>> = mutableMapOf(
// Essential