From 70e68abc9f15310db1e8581a8d8c38ea6022eaf2 Mon Sep 17 00:00:00 2001 From: Andrew Kozlov Date: Thu, 5 Mar 2026 18:00:37 +0100 Subject: [PATCH 1/5] ALT-10995 cleanFileLevelHighlights moved to EDT --- .../academy/python/learning/PyEduUtils.kt | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt index 6f30d4a9a..003c34fb0 100644 --- a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt +++ b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt @@ -6,6 +6,7 @@ import com.intellij.codeHighlighting.Pass import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx import com.intellij.execution.configurations.GeneralCommandLine import com.intellij.execution.util.ExecUtil +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.runReadAction import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.fileEditor.FileEditorManager @@ -151,18 +152,20 @@ fun installRequiredPackages(project: Project, sdk: Sdk) { indicator.fraction = 1.0 indicator.text = "Installation completed" - // Clear file-level warning that might linger while skeletons are updating - val editorManager = FileEditorManager.getInstance(project) - for (module in ModuleManager.getInstance(project).modules) { - val analyzer = DaemonCodeAnalyzerEx.getInstanceEx(module.project) - if (editorManager.hasOpenFiles()) { - editorManager.openFiles.forEach { file -> - file.findPsiFile(project)?.let { psiFile -> - analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, psiFile) + ApplicationManager.getApplication().invokeLater({ + // Clear file-level warning that might linger while skeletons are updating + val editorManager = FileEditorManager.getInstance(project) + for (module in ModuleManager.getInstance(project).modules) { + val analyzer = DaemonCodeAnalyzerEx.getInstanceEx(module.project) + if (editorManager.hasOpenFiles()) { + editorManager.openFiles.forEach { file -> + file.findPsiFile(project)?.let { psiFile -> + analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, psiFile) + } } } } - } + }, project.disposed) // Installation completed successfully LOG.warn("PyEduUtils: Installation finished successfully") From 629ac0ef858462c79e128b34eb867f4ac3d21508 Mon Sep 17 00:00:00 2001 From: Andrew Kozlov Date: Thu, 5 Mar 2026 18:05:11 +0100 Subject: [PATCH 2/5] ALT-10995 unnecessary for loop removed --- .../academy/python/learning/PyEduUtils.kt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt index 003c34fb0..a9b9c4183 100644 --- a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt +++ b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt @@ -155,16 +155,12 @@ fun installRequiredPackages(project: Project, sdk: Sdk) { ApplicationManager.getApplication().invokeLater({ // Clear file-level warning that might linger while skeletons are updating val editorManager = FileEditorManager.getInstance(project) - for (module in ModuleManager.getInstance(project).modules) { - val analyzer = DaemonCodeAnalyzerEx.getInstanceEx(module.project) - if (editorManager.hasOpenFiles()) { - editorManager.openFiles.forEach { file -> - file.findPsiFile(project)?.let { psiFile -> - analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, psiFile) - } - } - } - } + + val analyzer = DaemonCodeAnalyzerEx.getInstanceEx(project) + editorManager.openFiles + .asSequence() + .mapNotNull { it.findPsiFile(project) } + .forEach { analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, it) } }, project.disposed) // Installation completed successfully From 483f50a98911fd301fb7560a7b60583f3d3ea406 Mon Sep 17 00:00:00 2001 From: Andrew Kozlov Date: Thu, 5 Mar 2026 18:39:55 +0100 Subject: [PATCH 3/5] ALT-10995 running CI with push events --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 4615ac3fc..ed7bf7a20 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,7 @@ name: Plugin deployment on: - pull_request: + push: concurrency: group: publish-plugin-${{ github.ref_name }} From d702541aacadf80ab3ddfc65d506b9c49983e747 Mon Sep 17 00:00:00 2001 From: Andrew Kozlov Date: Mon, 9 Mar 2026 17:47:21 +0100 Subject: [PATCH 4/5] fixup! ALT-10995 running CI with push events This reverts commit 483f50a98911fd301fb7560a7b60583f3d3ea406. --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ed7bf7a20..4615ac3fc 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,7 @@ name: Plugin deployment on: - push: + pull_request: concurrency: group: publish-plugin-${{ github.ref_name }} From 00c7fef2c602ee1b784c1046389f5e2a5fc12949 Mon Sep 17 00:00:00 2001 From: Andrew Kozlov Date: Mon, 9 Mar 2026 17:51:10 +0100 Subject: [PATCH 5/5] fixup! ALT-10995 unnecessary for loop removed --- .../org/hyperskill/academy/python/learning/PyEduUtils.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt index a9b9c4183..6dcf1a300 100644 --- a/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt +++ b/intellij-plugin/hs-Python/src/org/hyperskill/academy/python/learning/PyEduUtils.kt @@ -157,10 +157,10 @@ fun installRequiredPackages(project: Project, sdk: Sdk) { val editorManager = FileEditorManager.getInstance(project) val analyzer = DaemonCodeAnalyzerEx.getInstanceEx(project) - editorManager.openFiles - .asSequence() - .mapNotNull { it.findPsiFile(project) } - .forEach { analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, it) } + for (file in editorManager.openFiles) { + val psiFile = file.findPsiFile(project) ?: continue + analyzer.cleanFileLevelHighlights(Pass.LOCAL_INSPECTIONS, psiFile) + } }, project.disposed) // Installation completed successfully