internal static CodeFormatter GetFormatter (out Document doc) { doc = IdeApp.Workbench.ActiveDocument; if (doc == null) return null; var editor = doc.Editor; if (editor == null) return null; return editor == null ? null : CodeFormatterService.GetFormatter (editor.MimeType); }
protected override void Update(CommandInfo info) { Document doc; var formatter = FormatBufferHandler.GetFormatter(out doc); info.Enabled = formatter != null && !formatter.IsDefault; }