Skip to content
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

Add support to colorize the output of notes and errors #37532

Closed
estebank opened this issue Nov 2, 2016 · 4 comments
Closed

Add support to colorize the output of notes and errors #37532

estebank opened this issue Nov 2, 2016 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@estebank
Copy link
Contributor

estebank commented Nov 2, 2016

Sometimes coloring messages could be useful to highlight either inlined code or an important part of the output text without changing the text itself.

@bluss
Copy link
Member

bluss commented Nov 2, 2016

rustc's errors are colored. Can you add more information about your configuration, where color is missing?

@nagisa
Copy link
Member

nagisa commented Nov 3, 2016

rustc --color=always

?

@estebank
Copy link
Contributor Author

estebank commented Nov 6, 2016

This ticket had a very bad summary, sorry about that. What I'm proposing is adding support to (all?) the note and help methods in Diagnostic, like for example note_expected_found to allow parts of NOTE and HELP lines to be colorized.

The idea to have this came to me while thinking about #21025, as something like this could be accomplished:

foo.rs:9:7: 9:8 error: mismatched types:
 expected `Foo<u8, i8>`,
    found `Foo<u8, i64>`
(expected i8,
    found i64)

@estebank estebank changed the title Add support to colorize the output of notes and errors. Add support to colorize the output of notes and errors Nov 6, 2016
@estebank
Copy link
Contributor Author

Related #21334.

@apasel422 apasel422 added the A-diagnostics Area: Messages for errors, warnings, and lints label Dec 28, 2016
bors added a commit that referenced this issue Jan 20, 2017
Teach Diagnostics to highlight text

Support styled `Diagnostic` output:

<img width="469" alt="mismatched types error with colorized types in the note" src="https://cloud.githubusercontent.com/assets/1606434/21871227/93a84198-d815-11e6-88b1-0ede3c7e28ef.png">

Closes #37532 and #38901.

r? @nikomatsakis CC @jonathandturner @nagisa @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

4 participants