Skip to content

Commit

Permalink
remove old object table formatters, clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsequitur committed Feb 4, 2023
1 parent 5fe4981 commit 2fa8996
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ namespace Microsoft.DotNet.Interactive.Formatting.Tests;

public partial class HtmlFormatterTests
{
public class Objects_TreeView : FormatterTestBase
public class Objects : FormatterTestBase
{
public Objects_TreeView()
{
HtmlFormatter.UseTreeView = true;
}

[Fact]
public void Formatters_are_generated_on_the_fly_for_anonymous_types()
{
Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions src/Microsoft.DotNet.Interactive.Formatting/HtmlFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@ static HtmlFormatter()

void Initialize()
{
#if (false) // FIX: delete
FormattersForAnyObject = new FormatterMapByType(typeof(HtmlFormatter<>), nameof(HtmlFormatter<object>.CreateTableFormatterForAnyObject));
#else
FormattersForAnyObject = new FormatterMapByType(typeof(HtmlFormatter<>), nameof(HtmlFormatter<object>.CreateTreeViewFormatterForAnyObject));
#endif
}
}

// FIX: (HtmlFormatter.UseTreeView) delete this
public static bool UseTreeView { get; set; }

// FIX: (HtmlFormatter) this can return a formatter with the wrong MIME type
public static ITypeFormatter GetPreferredFormatterFor(Type type) =>
Formatter.GetPreferredFormatterFor(type, MimeType);
Expand All @@ -56,8 +49,6 @@ internal static void FormatAndStyleAsPlainText(
{
context.RequireDefaultStyles();

// FIX: (FormatAndStyleAsPlainText) can this be refactored out to a reusable instance?

PocketView tag = div(pre(value.ToDisplayString(PlainTextFormatter.MimeType)));
tag.HtmlAttributes["class"] = "dni-plaintext";
tag.WriteTo(context);
Expand Down
Loading

0 comments on commit 2fa8996

Please sign in to comment.