GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — --pretty-er output by default by DanielRosenwasser · Pull Request #23408 · microsoft/TypeScript Conversation
|
|
I know the last time I did this (i.e. when I originally wrote Tests are Monday-Daniel-and-Wesley's problem. 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function shouldBePretty(options: CompilerOptions) { | ||
| if ((typeof options.pretty === "undefined" && typeof options.diagnosticStyle === "undefined") || options.diagnosticStyle === DiagnosticStyle.Auto) { | ||
| return !!sys.writeOutputIsTty && sys.writeOutputIsTty(); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
spacing
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| pretty: DiagnosticStyle.Pretty, | ||
| simple: DiagnosticStyle.Simple, | ||
| }), | ||
| }, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
spacing
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| } | ||
|
|
||
| function shouldBePretty(options: CompilerOptions) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So now there are two CLI flags that can tell tsc it's pretty. What if the user provides tsc --pretty false --diagnosticStyle pretty or tsc --pretty true --diagnosticStyle simple? Should there be a warning for providing both?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| category: Diagnostics.Command_line_Options, | ||
| description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental | ||
| }, | ||
| { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would rather we do not add a new flag if we can. i think auto is just pretty === undefined.
if we really need a new value i would make pretty take boolean | "auto"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
boolean | "auto" | "simple" | "styled"? (Where boolean toggles between auto and styled).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if ((typeof options.pretty === "undefined" && typeof options.diagnosticStyle === "undefined") || options.diagnosticStyle === DiagnosticStyle.Auto) { | ||
| return !!sys.writeOutputIsTty && sys.writeOutputIsTty(); | ||
| } | ||
| return options.diagnosticStyle === DiagnosticStyle.Pretty || options.pretty; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
!! options.pretty
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please 1. remove the extra flag, and 2. test on chakra
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| newLine: string; | ||
| useCaseSensitiveFileNames: boolean; | ||
| write(s: string): void; | ||
| writeOutputIsTty?(): boolean; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is this a reasonable name Wesley Wigham (@weswigham)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
TTY, not Tty.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| function shouldBePretty(options: CompilerOptions) { | ||
| if ((typeof options.pretty === "undefined")) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
extra parens.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
29ff745 to
25bb581
Compare
There was an error while loading. Please reload this page.
|
Tried it out. tsc.exe (the Chakra host-wrapped |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Daniel Rosenwasser (@DanielRosenwasser) please update https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Compiler%20Options.md as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hi Daniel Rosenwasser (@DanielRosenwasser),
I guess this is because tsc.exe doesn't set the console mode on Windows to enable processing of Virtual Terminal Sequences ( (I think Node.js parses these sequences itself and then calls the corresponding APIs like Can tsc.exe be updated to set this console mode? Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the pointers, I might look into it Konstantin Preißer (@kpreisser)! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.