-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Highlight code in rustc --explain
(WIP)
#39300
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Not ready for merging yet: It doesn't check wether the output can actually support color codes. Piping to other tools will cause control characters to be displayed: $ rustc --explain E0038 > file.txt && more file.txt (...) ``` ESC[33mtraitESC(BESC[m ESC(BESC[mFooESC(BESC[m ESC(BESC[mESC[33mwhereESC(BESC[m ESC(BESC[mESC[36mSelfESC(BESC[m:ESC(BESC[m ESC(BESC[mSizedESC(BESC[m ESC(BESC[m{ESC(BESC[m ESC(BESC[m}ESC(BESC[m ESC(BESC[m``` (...) |
☔ The latest upstream changes (presumably #39463) made this pull request unmergeable. Please resolve the merge conflicts. |
rustc --explain
rustc --explain
(WIP)
@estebank any status update here? Should I close this PR? |
@pnkfelix I've been offline for two weeks and haven't had a chance to clean this up for submission (it's lacking detection of pipe vs stdout output). Regardless, could you advice on the changes that were made already, in order to know wether they're in the right track? |
@estebank I'm not clear on whether we can just add new dependencies to |
@pnkfelix this PR didn't introduce any external crates, it moved existing code into its own crate. I'll try to get back to this PR this Saturday to clean it up for merging. |
Closing due to inactivity, but feel free to resubmit with a rebase! (seems like a nifty addition!) |
Internals thread.
New output: