[GHC] #15326: Add option to disable error message expression context (the 'In the expression' things)

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- A typical error looks like this: {{{ bug.hs:17:7: warning: [-Wdeferred-type-errors] ? No instance for (PolyList t0 [Integer]) arising from a use of ‘polyList’ ? In the expression: polyList 1 2 3 4 5 In an equation for ‘plh’: plh = polyList 1 2 3 4 5 | 17 | plh = polyList 1 2 3 4 5 | ^^^^^^^^^^^^^^^^^^ }}} Note the two lines starting with `In`. They waste two lines of error message space and now provides near zero utility since: 1. There's a caret view right below that context. 2. There are editor integrations that show squiggles right in the editor. Now we have an option `-f[no-]diagnostics-show-caret` that disables the caret. It would be great to have one that disables those code context lines too. As for naming. I'm thinking about `-f[no-]diagnostics-show-context`, which may be confused with constraint contexts, and `-f[no-]diagnostics-show- code-context`, which is a bit too long. I don't really know what those context lines are properly called, so maybe someone can come up with a more precise one. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by dramforever: Old description:
A typical error looks like this:
{{{ bug.hs:17:7: warning: [-Wdeferred-type-errors] ? No instance for (PolyList t0 [Integer]) arising from a use of ‘polyList’ ? In the expression: polyList 1 2 3 4 5 In an equation for ‘plh’: plh = polyList 1 2 3 4 5 | 17 | plh = polyList 1 2 3 4 5 | ^^^^^^^^^^^^^^^^^^ }}}
Note the two lines starting with `In`. They waste two lines of error message space and now provides near zero utility since:
1. There's a caret view right below that context. 2. There are editor integrations that show squiggles right in the editor.
Now we have an option `-f[no-]diagnostics-show-caret` that disables the caret. It would be great to have one that disables those code context lines too.
As for naming. I'm thinking about `-f[no-]diagnostics-show-context`, which may be confused with constraint contexts, and `-f[no-]diagnostics- show-code-context`, which is a bit too long. I don't really know what those context lines are properly called, so maybe someone can come up with a more precise one.
New description: A typical error looks like this: {{{ bug.hs:17:7: warning: [-Wdeferred-type-errors] ? No instance for (PolyList t0 [Integer]) arising from a use of ‘polyList’ ? In the expression: polyList 1 2 3 4 5 In an equation for ‘plh’: plh = polyList 1 2 3 4 5 | 17 | plh = polyList 1 2 3 4 5 | ^^^^^^^^^^^^^^^^^^ }}} Note the two lines starting with `In`. They waste two lines of error message space and now provides near zero utility since: 1. There's a caret view right below that context. 2. There are editor integrations that show squiggles right in the editor. Now we have an option `-f[no-]diagnostics-show-caret` that disables the caret. It would be great to have one that disables those code context lines too. This would make code errors shorter and easier to scroll through and read. And in editor integration, this would make the, say, error message popup less of a 'wall of text'. As for naming. I'm thinking about `-f[no-]diagnostics-show-context`, which may be confused with constraint contexts, and `-f[no-]diagnostics-show- code-context`, which is a bit too long. I don't really know what those context lines are properly called, so maybe someone can come up with a more precise one. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I'd be ok with someone adding such a flag. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: goldfire (added) Comment: It seems like this very much falls in the area where Richard has a student working this summer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15326: Add option to disable error message expression context (the 'In the expression' things) -------------------------------------+------------------------------------- Reporter: dramforever | Owner: nadine Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nadine): * owner: (none) => nadine -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15326#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC