这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@colombod
Copy link
Member

@colombod colombod commented Oct 9, 2019

Provide vt100 formatting in rendering

@colombod colombod force-pushed the feature/terminal_rendering branch 2 times, most recently from 2c51c42 to 5cf10b7 Compare October 10, 2019 13:26
traceBack.Add(commandFailed.Message);
break;
default:
traceBack.Add("Unhandled Exception");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the output look correct if the traceback is added as a single string with line breaks?

});
}

public const string MimeType = "text/vt100";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not the correct name for this mime type, since VT-100 is really a subset of the ANSI escape sequences that might be used.

_format = format;
}

public override void Format(T instance, TextWriter writer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check.

{
private readonly Action<T, TextWriter> _format;

public TerminalFormatter(Action<T, TextWriter> format)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check.

private static ITypeFormatter<T> CreateForObject(bool includeInternals)
{
var members = typeof(T).GetAllMembers(includeInternals)
.GetMemberAccessors<T>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better approach here would be to use the Destructurer class, which is what the HtmlFormatter uses to build up the table.

Copy link
Contributor

@jonsequitur jonsequitur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments.

@colombod colombod changed the title [WIP] terminal formatter and mime type support terminal formatter and mime type support Oct 10, 2019
@colombod colombod force-pushed the feature/terminal_rendering branch 7 times, most recently from 6aebe70 to 7122da7 Compare October 21, 2019 17:47
@colombod colombod force-pushed the feature/terminal_rendering branch 5 times, most recently from 31d7010 to b37552a Compare October 30, 2019 13:02
@colombod colombod force-pushed the feature/terminal_rendering branch 2 times, most recently from 104d503 to 0f47a1a Compare November 6, 2019 07:59
@colombod colombod force-pushed the feature/terminal_rendering branch from 0f47a1a to 1a2d831 Compare November 8, 2019 11:27
@colombod colombod closed this Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants