ghcide-2.2.0.0: The core of an IDE
Safe HaskellSafe-Inferred
LanguageHaskell2010

Development.IDE.Types.Diagnostics

Synopsis

Documentation

data Diagnostic #

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.

Constructors

Diagnostic 

Fields

  • _range :: Range

    The range at which the message applies

  • _severity :: Maybe DiagnosticSeverity

    The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.

  • _code :: Maybe (Int32 |? Text)

    The diagnostic's code, which usually appear in the user interface.

  • _codeDescription :: Maybe CodeDescription

    An optional property to describe the error code. Requires the code field (above) to be present/not null.

    Since: lsp-types-3.16.0

  • _source :: Maybe Text

    A human-readable string describing the source of this diagnostic, e.g. typescript or 'super lint'. It usually appears in the user interface.

  • _message :: Text

    The diagnostic's message. It usually appears in the user interface

  • _tags :: Maybe [DiagnosticTag]

    Additional metadata about the diagnostic.

    Since: lsp-types-3.15.0

  • _relatedInformation :: Maybe [DiagnosticRelatedInformation]

    An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.

  • _data_ :: Maybe Value

    A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.

    Since: lsp-types-3.16.0

Instances

Instances details
FromJSON Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

ToJSON Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Generic Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Associated Types

type Rep Diagnostic :: Type -> Type #

Show Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

NFData Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Methods

rnf :: Diagnostic -> () #

Eq Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Ord Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Hashable Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Pretty Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

Methods

pretty :: Diagnostic -> Doc ann #

prettyList :: [Diagnostic] -> Doc ann #

HasMessage Diagnostic Text 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasRange Diagnostic Range 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasCode Diagnostic (Maybe (Int32 |? Text)) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasCodeDescription Diagnostic (Maybe CodeDescription) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasData_ Diagnostic (Maybe Value) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasDiagnostics CodeAction (Maybe [Diagnostic]) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasDiagnostics CodeActionContext [Diagnostic] 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasDiagnostics PublishDiagnosticsParams [Diagnostic] 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasItems FullDocumentDiagnosticReport [Diagnostic] 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasItems RelatedFullDocumentDiagnosticReport [Diagnostic] 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasItems WorkspaceFullDocumentDiagnosticReport [Diagnostic] 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasRelatedInformation Diagnostic (Maybe [DiagnosticRelatedInformation]) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasSeverity Diagnostic (Maybe DiagnosticSeverity) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasSource Diagnostic (Maybe Text) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

HasTags Diagnostic (Maybe [DiagnosticTag]) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

type Rep Diagnostic 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.Diagnostic

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).

Constructors

ShowDiag

Report back to the user

HideDiag

Hide from user

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.

Constructors

DiagnosticSeverity_Error

Reports an error.

DiagnosticSeverity_Warning

Reports a warning.

DiagnosticSeverity_Information

Reports an information.

DiagnosticSeverity_Hint

Reports a hint.

Instances

Instances details
FromJSON DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

ToJSON DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Generic DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Associated Types

type Rep DiagnosticSeverity :: Type -> Type #

Show DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

NFData DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Methods

rnf :: DiagnosticSeverity -> () #

Eq DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Ord DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Hashable DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

LspEnum DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

Associated Types

type EnumBaseType DiagnosticSeverity #

Pretty DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

HasSeverity Diagnostic (Maybe DiagnosticSeverity) 
Instance details

Defined in Language.LSP.Protocol.Internal.Lens

type Rep DiagnosticSeverity 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

type Rep DiagnosticSeverity = D1 ('MetaData "DiagnosticSeverity" "Language.LSP.Protocol.Internal.Types.DiagnosticSeverity" "lsp-types-2.0.2.0-5pNSiFGKhkt7TIYGwBRGRu" '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 
Instance details

Defined in Language.LSP.Protocol.Internal.Types.DiagnosticSeverity

type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v) Source #

an IdeResult with a fingerprint