Add option to disable error message expression context (the 'In the expression' things)
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:
- There's a caret view right below that context.
- 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.