DMD now has colorized syntax highlighting in error messages

Adam D. Ruppe via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue May 16 08:25:17 PDT 2017


On Tuesday, 16 May 2017 at 15:11:21 UTC, Walter Bright wrote:
>     error: undefined identifier maybe
>
> Colorizing code distinguishes it from text.

What's important there? The generic syntax that you get from a 
syntax highlighter or the fact that it is the user input?

Drawing attention to `maybe` there is a good idea! But that's not 
because it is syntax highlighted, it is because that's the most 
important word in the message.

(btw I think it already has attention because of its placement, 
it doesn't need additional color. but the case I keep going back 
to, function overloading, puts important stuff in the middle of 
the message and that would be nice to stand out, as long as 
what's important - the mismatched arguments - are what stand out)

> It's also possible to use underlining.

Yeah, on some systems, but not really on Windows or even all 
linux terminals. Color has broader support, though you do want to 
be careful not to *depend* on color either.

> I'm working on the next PR that will auto-detect if Adam is 
> running the compiler, and will highlight code with blinking 
> text.

I'm afraid that won't work, my terminal emulator doesn't support 
blinking.

But if it detected it was me and outputted XML error messages, oh 
boy, I'd be excited about that! I honestly very much would love 
xml error messages.


More information about the Digitalmars-d-announce mailing list