diff --git a/platform/lang-api/src/com/intellij/codeInsight/actions/CodeInsightAction.java b/platform/lang-api/src/com/intellij/codeInsight/actions/CodeInsightAction.java index 9f0950e4f224..fdc9ea087577 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/actions/CodeInsightAction.java +++ b/platform/lang-api/src/com/intellij/codeInsight/actions/CodeInsightAction.java @@ -84,6 +84,7 @@ public abstract class CodeInsightAction extends AnAction implements UpdateInBack final DataContext dataContext = e.getDataContext(); Editor editor = getEditor(dataContext, project, true); if (editor == null) { + presentation.setVisible(!ActionPlaces.isPopupPlace(e.getPlace())); presentation.setEnabled(false); return; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/PresentableActionHandlerBasedAction.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/PresentableActionHandlerBasedAction.java index 306b77f1ad92..2cf8a057d2f1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/PresentableActionHandlerBasedAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/actions/PresentableActionHandlerBasedAction.java @@ -30,7 +30,11 @@ public abstract class PresentableActionHandlerBasedAction extends BaseCodeInsigh @Override public void update(@NotNull AnActionEvent event) { - // since previous handled may have changed the presentation, we need to restore it; otherwise it will stick. + if (!getLanguageExtension().hasAnyExtensions()) { + event.getPresentation().setEnabledAndVisible(false); + return; + } + // since previous handled may have changed the presentation, we need to restore it; otherwise it will stick. event.getPresentation().copyFrom(getTemplatePresentation()); applyTextOverride(event); super.update(event); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoSuperAction.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoSuperAction.java index 31dbde2ada1f..c8be68f272cd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoSuperAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoSuperAction.java @@ -21,7 +21,6 @@ import com.intellij.codeInsight.generation.actions.PresentableActionHandlerBased import com.intellij.lang.CodeInsightActions; import com.intellij.lang.Language; import com.intellij.lang.LanguageExtension; -import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.DumbService; @@ -57,17 +56,6 @@ public class GotoSuperAction extends PresentableActionHandlerBasedAction impleme return false; } - @Override - public void update(@NotNull final AnActionEvent event) { - if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) { - event.getPresentation().setVisible(true); - super.update(event); - } - else { - event.getPresentation().setVisible(false); - } - } - @NotNull @Override protected LanguageExtension getLanguageExtension() {