From 3e893b2748c2b76142683d4c0b25a497858c824f Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Dec 2011 18:19:09 +0100 Subject: [PATCH] don't show empty intention option list for file-level annotations (IDEA-59010) --- .../intention/impl/FileLevelIntentionComponent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/FileLevelIntentionComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/FileLevelIntentionComponent.java index c33bbca5e31b..37279aebd926 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/FileLevelIntentionComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/FileLevelIntentionComponent.java @@ -19,9 +19,7 @@ package com.intellij.codeInsight.intention.impl; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.daemon.impl.SeverityRegistrar; import com.intellij.codeInsight.daemon.impl.ShowIntentionsPass; -import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.lang.annotation.HighlightSeverity; -import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopupFactory; @@ -78,7 +76,9 @@ public class FileLevelIntentionComponent extends EditorNotificationPanel { if (intentions != null && !intentions.isEmpty()) { HighlightInfo.IntentionActionDescriptor descriptor = intentions.get(0).getFirst(); IntentionActionWithTextCaching actionWithTextCaching = step.wrapAction(descriptor, psiFile, psiFile, editor); - step = step.getSubStep(actionWithTextCaching, null); + if (step.hasSubstep(actionWithTextCaching)) { + step = step.getSubStep(actionWithTextCaching, null); + } } JBPopupFactory.getInstance().createListPopup(step).showUnderneathOf(myLabel); }