Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Diagnostic = Diagnostic {}
- data ShowDiagnostic
- type FileDiagnostic = (NormalizedFilePath, ShowDiagnostic, Diagnostic)
- type IdeResult v = ([FileDiagnostic], Maybe v)
- data DiagnosticSeverity
- type DiagnosticStore = HashMap NormalizedUri StoreItem
- ideErrorText :: NormalizedFilePath -> Text -> FileDiagnostic
- ideErrorWithSource :: Maybe Text -> Maybe DiagnosticSeverity -> a -> Text -> (a, ShowDiagnostic, Diagnostic)
- showDiagnostics :: [FileDiagnostic] -> Text
- showDiagnosticsColored :: [FileDiagnostic] -> Text
- type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v)
Documentation
data Diagnostic #
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
Diagnostic | |
|
Instances
data ShowDiagnostic Source #
Defines whether a particular diagnostic should be reported back to the user.
One important use case is "missing signature" code lenses, for which we need to enable the corresponding warning during type checking. However, we do not want to show the warning unless the programmer asks for it (#261).
Instances
Show ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics showsPrec :: Int -> ShowDiagnostic -> ShowS # show :: ShowDiagnostic -> String # showList :: [ShowDiagnostic] -> ShowS # | |
NFData ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics rnf :: ShowDiagnostic -> () # | |
Eq ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics (==) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (/=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # | |
Ord ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics compare :: ShowDiagnostic -> ShowDiagnostic -> Ordering # (<) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (<=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (>) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (>=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # max :: ShowDiagnostic -> ShowDiagnostic -> ShowDiagnostic # min :: ShowDiagnostic -> ShowDiagnostic -> ShowDiagnostic # |
type FileDiagnostic = (NormalizedFilePath, ShowDiagnostic, Diagnostic) Source #
Human readable diagnostics for a specific file.
This type packages a pretty printed, human readable error message along with the related source location so that we can display the error on either the console or in the IDE at the right source location.
type IdeResult v = ([FileDiagnostic], Maybe v) Source #
The result of an IDE operation. Warnings and errors are in the Diagnostic, and a value is in the Maybe. For operations that throw an error you expect a non-empty list of diagnostics, at least one of which is an error, and a Nothing. For operations that succeed you expect perhaps some warnings and a Just. For operations that depend on other failing operations you may get empty diagnostics and a Nothing, to indicate this phase throws no fresh errors but still failed.
A rule on a file should only return diagnostics for that given file. It should not propagate diagnostic errors through multiple phases.
data DiagnosticSeverity #
The diagnostic's severity.
DiagnosticSeverity_Error | Reports an error. |
DiagnosticSeverity_Warning | Reports a warning. |
DiagnosticSeverity_Information | Reports an information. |
DiagnosticSeverity_Hint | Reports a hint. |
Instances
ideErrorText :: NormalizedFilePath -> Text -> FileDiagnostic Source #
ideErrorWithSource :: Maybe Text -> Maybe DiagnosticSeverity -> a -> Text -> (a, ShowDiagnostic, Diagnostic) Source #
showDiagnostics :: [FileDiagnostic] -> Text Source #
showDiagnosticsColored :: [FileDiagnostic] -> Text Source #
type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v) Source #
an IdeResult with a fingerprint