From 20b3e1b0fff9ab2cf8fdad04ff5a66674b1e0a79 Mon Sep 17 00:00:00 2001 From: Ilya Siamionau Date: Wed, 31 Jan 2024 17:56:07 +0100 Subject: [PATCH] CM-31986 - Fix quick fix performing on hover --- .../intentions/CycodeIgnoreIntentionQuickFix.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/kotlin/com/cycode/plugin/intentions/CycodeIgnoreIntentionQuickFix.kt b/src/main/kotlin/com/cycode/plugin/intentions/CycodeIgnoreIntentionQuickFix.kt index aa1585c..8e13a8f 100644 --- a/src/main/kotlin/com/cycode/plugin/intentions/CycodeIgnoreIntentionQuickFix.kt +++ b/src/main/kotlin/com/cycode/plugin/intentions/CycodeIgnoreIntentionQuickFix.kt @@ -66,6 +66,17 @@ class CycodeIgnoreIntentionQuickFix( } override fun invoke(project: Project, editor: Editor?, file: PsiFile?) { + if (file == null || file != file.originalFile) { + /** + * since 2022.3, JB introduced "Intention Action Preview" feature + * which breaks our ignore options + * because it performs quick fix intention on a copy of the file on hover + * see https://plugins.jetbrains.com/docs/intellij/code-intentions-preview.html + */ + thisLogger().debug("skip quick fix intention for virtually copied files") + return + } + thisLogger().warn("Ignore quick fix intention has been invoked") // we are removing is from UI first to show how it's blazing fast and then apply it in the background