| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Tokstyle.C.Linter
Synopsis
- analyse :: [Text] -> CTranslUnit -> [LinterError]
- analyseText :: [Text] -> CTranslUnit -> [Text]
- allWarnings :: [Text]
- markdown :: Text
- renderIO :: [LinterError] -> IO [Doc AnsiStyle]
- renderPure :: Map FilePath [Text] -> [LinterError] -> [Doc AnsiStyle]
- type LinterError = Diagnostic CPosition
- data DiagnosticLevel
- data Doc ann
- data AnsiStyle
- diagToText :: IsPosition pos => Diagnostic pos -> Text
Documentation
analyse :: [Text] -> CTranslUnit -> [LinterError] Source #
analyseText :: [Text] -> CTranslUnit -> [Text] Source #
allWarnings :: [Text] Source #
renderPure :: Map FilePath [Text] -> [LinterError] -> [Doc AnsiStyle] Source #
type LinterError = Diagnostic CPosition Source #
data DiagnosticLevel #
Constructors
| ErrorLevel | |
| WarningLevel | |
| NoteLevel | |
| HelpLevel |
Instances
| Eq DiagnosticLevel | |
Defined in Language.Cimple.Diagnostics Methods (==) :: DiagnosticLevel -> DiagnosticLevel -> Bool # (/=) :: DiagnosticLevel -> DiagnosticLevel -> Bool # | |
| Ord DiagnosticLevel | |
Defined in Language.Cimple.Diagnostics Methods compare :: DiagnosticLevel -> DiagnosticLevel -> Ordering # (<) :: DiagnosticLevel -> DiagnosticLevel -> Bool # (<=) :: DiagnosticLevel -> DiagnosticLevel -> Bool # (>) :: DiagnosticLevel -> DiagnosticLevel -> Bool # (>=) :: DiagnosticLevel -> DiagnosticLevel -> Bool # max :: DiagnosticLevel -> DiagnosticLevel -> DiagnosticLevel # min :: DiagnosticLevel -> DiagnosticLevel -> DiagnosticLevel # | |
| Show DiagnosticLevel | |
Defined in Language.Cimple.Diagnostics Methods showsPrec :: Int -> DiagnosticLevel -> ShowS # show :: DiagnosticLevel -> String # showList :: [DiagnosticLevel] -> ShowS # | |
The abstract data type represents pretty documents that have
been annotated with data of type Doc annann.
More specifically, a value of type represents a non-empty set of
possible layouts of a document. The layout functions select one of these
possibilities, taking into account things like the width of the output
document.Doc
The annotation is an arbitrary piece of data associated with (part of) a document. Annotations may be used by the rendering backends in order to display output differently, such as
- color information (e.g. when rendering to the terminal)
- mouseover text (e.g. when rendering to rich HTML)
- whether to show something or not (to allow simple or detailed versions)
The simplest way to display a Doc is via the Show class.
>>>putStrLn (show (vsep ["hello", "world"]))hello world
Instances
Render the annotated document in a certain style. Styles not set in the annotation will use the style of the surrounding document, or the terminal’s default if none has been set yet.
style =colorGreen<>boldstyledDoc =annotatestyle "hello world"
Instances
| Eq AnsiStyle | |
| Ord AnsiStyle | |
Defined in Prettyprinter.Render.Terminal.Internal | |
| Show AnsiStyle | |
| Semigroup AnsiStyle | Keep the first decision for each of foreground color, background color, boldness, italication, and underlining. If a certain style is not set, the terminal’s default will be used. Example:
is red because the first color wins, and not bold because (or if) that’s the terminal’s default. |
| Monoid AnsiStyle |
|
diagToText :: IsPosition pos => Diagnostic pos -> Text #