miniblog.

← Back to all posts
65
I'm experimenting with diagnostics formatting. * I've added a left margin, showing both the file name and line numbers * I'm showing one line of context above/below the offending line. * I'm using grey for comments. What do you think? Is there anything you'd change?
PhotoPhoto

5 Comments

@wilfredh maybe omit the context line if it's empty anyway? But looks good otherwise!
@wilfredh If the last context line has enough space, like in all of your examples, you could merge the marker into that line.
@wilfredh I have always wondered why compilers put arrows underneath the failing code when they could just mark the offending text with a red background. That would be much nicer to look at IMO.
@atjn It's probably just historical convention, but it does work nicely when you're just looking at compiler logs. If you only had colour, logs from e.g. you CI system might not show where the offending code is. You also see some compilers put error messages next to the arrows, which can be easier to read.