Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stylize tsc's error messages with color and context#5140

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielRosenwasser merged 26 commits intomasterfromiFeelPrettyErr
Nov 3, 2015

Conversation

@DanielRosenwasser
Copy link
Member

This change seeks to make our output a little easier on the eyes and addresses#3852. I suggest this PR's final changes be reviewed rather than going commit-by-commit.

Firstly, a new flag is introduced:--diagnosticStyle. It accepts the optionspretty andsimple. It is currently marked as experimental, and we can bikeshed over the names later.

If--diagnosticStyle simple is used, the user will get the same behavior as they experience today.Note thatsimple is left as the default.

If--diagnosticStyle pretty is used as an option, then we check if we are outputting to a terminal-style descriptor. If we areentirely sure, then we stylize the output with color. If not (e.g. output is being piped, forwarded to a file, etc.) we make the output readable so that no special control characters are used in the output.

Here's some screenshots/gifs to give you an idea of what this looks like right now.

watchpretty

Monokai
image

Solarized Light
image

Terminal Basic
image

My Stupid Terminal Theme
image

Cygwin's MinTTY
image

cmd.exe
image

GNOME Terminal Defaults in Ubuntu
image

Conflicts:src/compiler/sys.tssrc/compiler/tsc.ts
Conflicts:src/compiler/diagnosticInformationMap.generated.tssrc/compiler/diagnosticMessages.jsonsrc/compiler/sys.tssrc/compiler/tsc.ts
Conflicts:src/compiler/commandLineParser.ts
@myitcv
Copy link

Note that simple is left as the default.

Thanks. This should mean that any tools that consume the output fromtsc continue to work.

@DanielRosenwasser
Copy link
MemberAuthor

@myitcv this was one of the original concerns I heard a lot of from other members of the team; however, I think it would be a good idea to make it a default option intsconfig.json when usingtsc --init.

@Gaelan
Copy link

One thing I would really appreciate would be some sort of coloring for the "starting incremental recompilation" message, so we can more easily tell which errors are current.

@tinganho
Copy link
Contributor

Awesome that it shows the line numbers! I would also like the message when overflowed to be tabbed to the starting position. For example, the text parttype 'I' was too long and began on the next line on column 0. It would be awesome if that part began in column 2 instead.

I guess you would add colors on the messages too?

@DanielRosenwasser
Copy link
MemberAuthor

@tinganho I think terminal size detection/wrapping is better left for a separate issue/PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

capture the ellipses in a const, and so is its length.

Copy link
Contributor

Choose a reason for hiding this comment

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

also applies to the squiggle down below.

@mhegazy
Copy link
Contributor

LGTM. a few nits, but other than than that 👍

@mhegazy
Copy link
Contributor

DanielRosenwasser added a commit that referenced this pull requestNov 3, 2015
Stylize tsc's error messages with color and context
@DanielRosenwasserDanielRosenwasser merged commit38b990b intomasterNov 3, 2015
@DanielRosenwasserDanielRosenwasser deleted the iFeelPrettyErr branchNovember 3, 2015 00:31
@mhegazymhegazy mentioned this pull requestDec 9, 2015
@microsoftmicrosoft locked and limited conversation to collaboratorsJun 19, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@DanielRosenwasser@myitcv@Gaelan@tinganho@mhegazy@weswigham@mihailik@msftclas

[8]ページ先頭

©2009-2025 Movatter.jp