Add caret diagnostics
authorPhil Ruffwind <rf@rufflewind.com>
Thu, 22 Dec 2016 22:06:51 +0000 (17:06 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 23 Dec 2016 21:44:47 +0000 (16:44 -0500)
commit158530a5450b27eb5ae2d75b7895fd1662dde13b
tree7a0be5291bb05086e6f656f20cdbee23b139a8a8
parent8f89e76389569b73ce0d7550302641bbea438dfc
Add caret diagnostics

This is controlled by -f[no-]diagnostics-show-caret.

Example of what it looks like:
```
    |
 42 |     x = 1 + ()
    |         ^^^^^^
```
This is appended to each diagnostic message.

Test Plan:
testsuite/tests/warnings/should_fail/CaretDiagnostics1
testsuite/tests/warnings/should_fail/CaretDiagnostics2

Reviewers: simonpj, austin, bgamari

Reviewed By: simonpj, bgamari

Subscribers: joehillen, mpickering, Phyx, simonpj, alanz, thomie

Differential Revision: https://phabricator.haskell.org/D2718

GHC Trac Issues: #8809
16 files changed:
.arc-linters/check-binaries.py
.arc-linters/check-cpp.py
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
compiler/main/ErrUtils.hs-boot
docs/users_guide/using.rst
testsuite/mk/test.mk
testsuite/tests/ghci/scripts/T9293.stdout
testsuite/tests/ghci/scripts/ghci024.stdout
testsuite/tests/ghci/scripts/ghci057.stdout
testsuite/tests/warnings/should_fail/CaretDiagnostics1.hs [new file with mode: 0644]
testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_fail/CaretDiagnostics2.hs [new file with mode: 0644]
testsuite/tests/warnings/should_fail/CaretDiagnostics2.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_fail/all.T
utils/mkUserGuidePart/Options/Verbosity.hs