
#8809: Prettier error messages? -------------------------------------+------------------------------------- Reporter: joelteon | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): #8809,#10073,#10179 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by Rufflewind): I'd like to make an incremental attempt towards improving the aesthetics. Specifically, I wish to: - Add colors in a style similar to Clang/GCC. - Allow the color to be turned on and off via `-fdiagnostics- color=(always|auto|no)`. - Implement auto detection of color support (`auto`). - Display one line of code extracted from the original source code, along with a marker indicating the location of the error. So the final result should look like this, but with the usual white-on- black terminal colors: {{{ #!html <code><pre><span style="font-weight: bold">/home/rf/revad.hs:26:1: <span style="color: magenta">warning:</span> [<span style="color: magenta ">-Wunused-top-binds</span>] Defined but not used: ‘</span>add<span style="font-weight: bold">’</span> add = Func $ \ (x, y) -> <span style="color: green; font-weight: bold">^~~</span> </pre></code> }}} Here is an attempt at implementing the first two objectives: https://github.com/ghc/ghc/compare/master...Rufflewind:diagnostics-color -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8809#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler