-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][Diagnostics] Make 'note' color CYAN #66997
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
Conversation
@llvm/pr-subscribers-clang ChangesJust using BLACK makes it invisible in terminals with a dark background. See this screenshot: With current clang, the "note:" part of the note is almost invisible, because we select BLACK as its color. Use CYAN instead, which is also what gcc does. Full diff: https://github.com/llvm/llvm-project/pull/66997.diff 1 Files Affected:
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index eaa6e8d29a1dece..89c7ef505159e13 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -25,7 +25,7 @@
using namespace clang;
static const enum raw_ostream::Colors noteColor =
- raw_ostream::BLACK;
+ raw_ostream::CYAN;
static const enum raw_ostream::Colors remarkColor =
raw_ostream::BLUE;
static const enum raw_ostream::Colors fixitColor =
|
This doesn't really fix the problem, it just shuffles it around. I expect people with blue(ish) terminals will experience the same issue after this is applied, so we ought to try and detect what colours to print out, and then have compatible themes. |
I know, this only fixes the problem in the vast majority of cases. I don't know of any tool implementing dynamic background color checking so it can adjust the foreground color though. This is a one-liner that fixes the problem on terminals with a dark background and the solution also works on light backgrounds. So, basically all of them. |
Before approving this change, I want confirmation that it doesn't adversely impact popular themes. The Tomorrow Night Blue theme that's in my Visual Studio Code client (not my theme, but one of the defaults, I think) does need to change the hue of its blue text. If we can't detect the background, then I think it's extra important that we test this on as many themes as possible, and with colourblind filters as well. |
Not really, CYAN is only cyan if that's what your terminal decides to render the color 6 as, you can configure it to be orange if you want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A shed by any other color would store bikes as well.
Oh, interesting. In that case, I see no problems. |
I keep forgetting to add release notes and @AaronBallman hasn't reminded me in a while - is this worth a release note? |
Yes! |
Just using BLACK makes it invisible in terminals with a dark background.
Just using BLACK makes it invisible in terminals with a dark background.
Just using BLACK makes it invisible in terminals with a dark background.
See this screenshot:
With current clang, the "note:" part of the note is almost invisible, because we select BLACK as its color.
Use CYAN instead, which is also what gcc does.