[GHC] #13718: diagnostic colors: differentiate between message head and message body

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
           Reporter:  int-e          |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1-rc2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:  #13444
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 When a diagnostic message is printed, currently the whole message is
 colored by the "message" color (bold by default). I'd find it useful if
 the message body and the header could be differentiated (I do like the
 idea that the header stands out).

 Motivation: Consider the following error message,
 {{{
 GHCi, version 8.2.0.20170508: http://www.haskell.org/ghc/  :? for help
 Prelude> () ()

 <interactive>:1:1: error:
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at <interactive>:1:1)
 }}}
 which by default is all bold, with the {{{error:}}} part in red. I want
 the message body to use normal text. Thanks to #13444 I can achieve that
 by setting {{{GHC_COLORS="message=0"}}}. However, that setting also
 affects the initial {{{<interactive>:1:1}}} part of the headline, which
 now looks odd because normal and bold text are mixed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * cc: Rufflewind (added)


Comment:

 Since I had trouble visualizing this, let me try to format what you're
 seeing.

 With the default `GHC_COLORS`, this is what you see:

 {{{
 #!html
 <pre>
 Prelude> () ()

 <strong>&lt;interactive&gt;:1:1: <span style="color: red">error:</span>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 &lt;interactive&gt;:1:1)</strong></pre>
 }}}

 With `GHC_COLORS="message=0"`, this is what you see:

 {{{
 #!html
 <pre>
 Prelude> () ()

 &lt;interactive&gt;:1:1: <strong><span style="color:
 red">error:</span></strong>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 &lt;interactive&gt;:1:1)</pre>
 }}}

 And this is what you'd prefer to see with `GHC_COLORS="message=0"`:

 {{{
 #!html
 <pre>
 Prelude> () ()

 <strong>&lt;interactive&gt;:1:1: <span style="color:
 red">error:</span></strong>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 &lt;interactive&gt;:1:1)</pre>
 }}}

 Is that correct?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by int-e):

 Replying to [comment:1 RyanGlScott]:
 > Since I had trouble visualizing this, let me try to format what you're
 seeing.

 Thanks for the effort! Yes, that is correct.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):  phab:D3599
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by Rufflewind):

 * status:  new => patch
 * differential:   => phab:D3599


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):  phab:D3599
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"139ef04bdbd14b74dd6202295e11a37295442fc8/ghc"
 139ef04b/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="139ef04bdbd14b74dd6202295e11a37295442fc8"
 Add "header" to GHC_COLORS

 Add "header" to GHC_COLORS and allow colors to be inherited from the
 surroundings.

 Test Plan: validate

 Reviewers: austin, bgamari

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13718

 Differential Revision: https://phabricator.haskell.org/D3599
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):  phab:D3599
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  patch => closed
 * resolution:   => fixed
 * milestone:   => 8.2.1


Comment:

 Merged to `ghc-8.2` as c0b82c3826c8e1b26d198f050baa9d5077370247

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):  phab:D3599
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by int-e):

 Thanks! For the record, using {{{GHC_COLORS="message=0:header=1"}}} now
 gets me the coloring I wanted.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13718#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets