diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java index f645b330de78..1f9598367d4e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java @@ -284,7 +284,9 @@ public class ReformatCodeAction extends AnAction implements DumbAware, LightEdit return false; } - return LanguageFormatting.INSTANCE.forContext(file) != null; + if (LanguageFormatting.INSTANCE.forContext(file) != null) { + return true; + } } else if (files != null && containsOnlyFiles(files)) { boolean anyFormatters = false; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java index e44a8a9c2f8e..265fa90ac6cb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ShowReformatFileDialog.java @@ -36,7 +36,9 @@ public class ShowReformatFileDialog extends AnAction implements DumbAware { return; } - presentation.setEnabled(LanguageFormatting.INSTANCE.forContext(file) != null); + if (LanguageFormatting.INSTANCE.forContext(file) != null) { + presentation.setEnabled(true); + } } @Override