mirror of
https://github.com/Mesabloo/diagnose.git
synced 2024-09-11 19:27:32 +03:00
export 'prettyDiagnostic' as per #5
This commit is contained in:
parent
c6cf60ccca
commit
8b4d8b45f8
@ -21,6 +21,7 @@ import Error.Diagnose.Diagnostic.Internal as Export
|
||||
addFile,
|
||||
addReport,
|
||||
def,
|
||||
prettyDiagnostic,
|
||||
printDiagnostic,
|
||||
)
|
||||
import System.IO as Export (stderr, stdout)
|
||||
|
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user