Safe Haskell | None |
---|---|
Language | GHC2021 |
Development.IDE.Types.Diagnostics
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 #
Constructors
Diagnostic | |
Instances
data ShowDiagnostic #
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 # | |
Defined in Development.IDE.Types.Diagnostics Methods showsPrec :: Int -> ShowDiagnostic -> ShowS # show :: ShowDiagnostic -> String # showList :: [ShowDiagnostic] -> ShowS # | |
NFData ShowDiagnostic # | |
Defined in Development.IDE.Types.Diagnostics Methods rnf :: ShowDiagnostic -> () # | |
Eq ShowDiagnostic # | |
Defined in Development.IDE.Types.Diagnostics Methods (==) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (/=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # | |
Ord ShowDiagnostic # | |
Defined in Development.IDE.Types.Diagnostics Methods 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) #
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) #
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 #
Constructors
DiagnosticSeverity_Error | |
DiagnosticSeverity_Warning | |
DiagnosticSeverity_Information | |
DiagnosticSeverity_Hint |
Instances
FromJSON DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods parseJSON :: Value -> Parser DiagnosticSeverity # parseJSONList :: Value -> Parser [DiagnosticSeverity] # | |||||
ToJSON DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods toJSON :: DiagnosticSeverity -> Value # toEncoding :: DiagnosticSeverity -> Encoding # toJSONList :: [DiagnosticSeverity] -> Value # toEncodingList :: [DiagnosticSeverity] -> Encoding # omitField :: DiagnosticSeverity -> Bool # | |||||
Generic DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Associated Types
Methods from :: DiagnosticSeverity -> Rep DiagnosticSeverity x # to :: Rep DiagnosticSeverity x -> DiagnosticSeverity # | |||||
Show DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods showsPrec :: Int -> DiagnosticSeverity -> ShowS # show :: DiagnosticSeverity -> String # showList :: [DiagnosticSeverity] -> ShowS # | |||||
NFData DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods rnf :: DiagnosticSeverity -> () # | |||||
Eq DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods (==) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # (/=) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # | |||||
Ord DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Methods compare :: DiagnosticSeverity -> DiagnosticSeverity -> Ordering # (<) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # (<=) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # (>) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # (>=) :: DiagnosticSeverity -> DiagnosticSeverity -> Bool # max :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity # min :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity # | |||||
Hashable DiagnosticSeverity | |||||
LspEnum DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity Associated Types
Methods knownValues :: Set DiagnosticSeverity toEnumBaseType :: DiagnosticSeverity -> EnumBaseType DiagnosticSeverity fromEnumBaseType :: EnumBaseType DiagnosticSeverity -> Maybe DiagnosticSeverity | |||||
Pretty DiagnosticSeverity | |||||
HasSeverity Diagnostic (Maybe DiagnosticSeverity) | |||||
Defined in Language.LSP.Protocol.Types.Lens Methods | |||||
type Rep DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity type Rep DiagnosticSeverity = D1 ('MetaData "DiagnosticSeverity" "Language.LSP.Protocol.Internal.Types.DiagnosticSeverity" "lsp-types-2.2.0.0-8Xein21J7hgLjsXepwEL9j" 'False) ((C1 ('MetaCons "DiagnosticSeverity_Error" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DiagnosticSeverity_Warning" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DiagnosticSeverity_Information" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DiagnosticSeverity_Hint" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
type EnumBaseType DiagnosticSeverity | |||||
Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity type EnumBaseType DiagnosticSeverity = UInt |
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) #
an IdeResult with a fingerprint