Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions gradle-252.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ ideaVersion=IU-2025.2.4
clionVersion=CL-2025.2.4
pycharmVersion=PC-2025.2.4
riderVersion=RD-2025.2.4
# for running idea, pycharm, webstorm or android studio with plugins locally
# Path to pre-built plugin ZIP for runIde tasks (optional, overrides building from source)
localPluginPath=/Users/alexanderpetrov/Downloads/JetBrainsAcademy-2025.11-2025.2-994.zip
3 changes: 0 additions & 3 deletions gradle-253.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ ideaVersion=IU-2025.3
clionVersion=CL-2025.3
pycharmVersion=PC-2025.3
riderVersion=RD-2025.3
# for running idea, pycharm, webstorm or android studio with plugins locally
# Path to pre-built plugin ZIP for runIde tasks (optional, overrides building from source)
localPluginPath=/Users/alexanderpetrov/Downloads/JetBrainsAcademy-2025.11-2025.3-329.zip
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class CourseValidationHelper(
}

private suspend fun TestSuiteBuilder.validateTaskDescriptionLinks(project: Project, task: Task) {
val text = readAction { task.getFormattedTaskText(project) } ?: return
val text = task.getFormattedTaskText(project)
?: return
val links = extractLinks(project, task, text)
// Don't create empty node if no links in the task description
if (links.isEmpty()) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun StudyItem.getDir(courseDir: VirtualFile): VirtualFile? {
lessonParent.getDir(courseDir)?.findFileByRelativePath(lessonParent.getPathToChildren())?.findChild(name)
}

is Task -> (parentOrNull as? Lesson)?.getDir(courseDir)?.let { findDir(it) }
is Task -> (parentOrNull as? Lesson)?.getDir(courseDir)?.findChild(name)
else -> error("Can't find directory for the item $itemType")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ private fun VirtualFile.toDescriptionFormat(): DescriptionFormat =
DescriptionFormat.values().firstOrNull { it.extension == extension }
?: loadingError(EduCoreBundle.message("yaml.editor.invalid.description"))

@RequiresReadLock
fun Task.getFormattedTaskText(project: Project): String? {
var text = getTaskText(project) ?: return null
var text = runReadAction {
getTaskText(project)
} ?: return null

text = StringUtil.replace(text, "%IDE_NAME%", ApplicationNamesInfo.getInstance().fullProductName)
val textBuffer = StringBuffer(text)
replaceActionIDsWithShortcuts(textBuffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.hyperskill.academy.learning.taskToolWindow.ui

import com.intellij.openapi.Disposable
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.registry.Registry
import com.intellij.util.ui.update.MergingUpdateQueue
Expand Down Expand Up @@ -65,10 +64,8 @@ abstract class TaskToolWindow(protected val project: Project) : Disposable {
const val TASK_DESCRIPTION_UPDATE_DELAY_REGISTRY_KEY: String = "hyperskill.task.description.update.delay"

fun getTaskDescription(project: Project, task: Task?, uiMode: JavaUILibrary): String {
val openedTask = task ?: return EduCoreBundle.message("label.open.task")
val taskText = runReadAction {
openedTask.getFormattedTaskText(project)
} ?: return EduCoreBundle.message("label.open.task")
val taskText = task?.getFormattedTaskText(project)
?: return EduCoreBundle.message("label.open.task")
val transformerContext = HtmlTransformerContext(project, task, uiMode)
return TaskDescriptionTransformer.transform(taskText, transformerContext)
}
Expand Down
Loading