1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 10:27:45 +03:00

Bold the source line/column.

This commit is contained in:
Rob Rix 2017-05-19 16:11:02 -04:00
parent fa3407f045
commit 5e88098782

View File

@ -167,7 +167,7 @@ data ErrorCause symbol
-- | Pretty-print an Error with reference to the source where it occurred.
showError :: Show symbol => Source.Source -> Error symbol -> ShowS
showError source Error{..}
= showSourcePos errorPos . showString ": " . withSGRCode [SetColor Foreground Vivid Red] (showString "error") . showString ": " . showExpectation . showChar '\n'
= withSGRCode [SetConsoleIntensity BoldIntensity] (showSourcePos errorPos) . showString ": " . withSGRCode [SetColor Foreground Vivid Red] (showString "error") . showString ": " . showExpectation . showChar '\n'
. showString context -- actualLines results include line endings, so no newline here
. showString (replicate (succ (Info.column errorPos + lineNumberDigits)) ' ') . showChar '^' . showChar '\n'
. showString (prettyCallStack callStack) . showChar '\n'