partial revert of 9a35b941d to restore external formatters functionality (e.g., in LSP-based plugins)

IJ-CR-116890

GitOrigin-RevId: ac85db6f9668eeeedb265b2ce48116d6e3e708ac
This commit is contained in:
Alexander Doroshko
2023-10-16 23:37:22 +00:00
committed by intellij-monorepo-bot
parent 30cd6c0214
commit ff92f374dc
2 changed files with 6 additions and 2 deletions
@@ -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;
@@ -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