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

Highlight code in rustc --explain (WIP) #39300

Closed
wants to merge 3 commits into from

Conversation

estebank
Copy link
Contributor

Internals thread.

New output:

colorized code

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank
Copy link
Contributor Author

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```
(...)

@bors
Copy link
Contributor

bors commented Feb 4, 2017

☔ The latest upstream changes (presumably #39463) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix pnkfelix changed the title Highlight code in rustc --explain Highlight code in rustc --explain (WIP) Feb 20, 2017
@pnkfelix
Copy link
Member

pnkfelix commented Mar 6, 2017

@estebank any status update here? Should I close this PR?

@estebank
Copy link
Contributor Author

estebank commented Mar 7, 2017

@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?

@pnkfelix
Copy link
Member

@estebank I'm not clear on whether we can just add new dependencies to rustc; the last time I tried to just throw in some external crates to the Cargo.toml, @alexcrichton told me that our vendoring requirements make it difficult to add new crates.

@estebank
Copy link
Contributor Author

@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.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to resubmit with a rebase!

(seems like a nifty addition!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants