-
Notifications
You must be signed in to change notification settings - Fork 563
terminal formatter and mime type support #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2c51c42 to
5cf10b7
Compare
| traceBack.Add(commandFailed.Message); | ||
| break; | ||
| default: | ||
| traceBack.Add("Unhandled Exception"); |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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.
jonsequitur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments.
6aebe70 to
7122da7
Compare
31d7010 to
b37552a
Compare
104d503 to
0f47a1a
Compare
0f47a1a to
1a2d831
Compare
Provide vt100 formatting in rendering