export 'prettyDiagnostic' as per #5

This commit is contained in:
Mesabloo 2022-05-02 15:11:02 +02:00
parent c6cf60ccca
commit 8b4d8b45f8
2 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import Error.Diagnose.Diagnostic.Internal as Export
addFile,
addReport,
def,
prettyDiagnostic,
printDiagnostic,
)
import System.IO as Export (stderr, stdout)

View File

@ -63,8 +63,12 @@ instance ToJSON msg => ToJSON (Diagnostic msg) where
]
#endif
-- | Pretty prints a diagnostic into a 'Doc'ument that can be output using
-- 'Text.PrettyPrint.ANSI.Leijen.hPutDoc' or 'Text.PrettyPrint.ANSI.Leijen.displayIO'.
-- | Pretty prints a 'Diagnostic' into a 'Doc'ument that can be output using 'hPutDoc'.
--
-- Colors are put by default.
-- If you do not want these, just 'unAnnotate' the resulting document like so:
--
-- >>> let doc = unAnnotate (prettyDiagnostic withUnicode tabSize diagnostic)
prettyDiagnostic ::
Pretty msg =>
-- | Should we use unicode when printing paths?