hls-cabal-plugin-0.1.0.0: Cabal integration plugin with Haskell Language Server
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ide.Plugin.Cabal.Diagnostics

Contents

Synopsis

Documentation

errorDiagnostic :: NormalizedFilePath -> PError -> FileDiagnostic Source #

Produce a diagnostic from a Cabal parser error

warningDiagnostic :: NormalizedFilePath -> PWarning -> FileDiagnostic Source #

Produce a diagnostic from a Cabal parser warning

positionFromCabalPosition :: Position -> Position Source #

Convert a Position from Cabal to a Range that LSP understands.

Prefer this function over hand-rolled unpacking/packing, since LSP is zero-based, while Cabal is one-based.

>>> positionFromCabalPosition $ Lib.Position 1 1
Position 0 0

Re-exports

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.

data Diagnostic #

Instances

Instances details
FromJSON Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

ToJSON Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Generic Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Associated Types

type Rep Diagnostic :: Type -> Type #

Read Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Show Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

NFData Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Methods

rnf :: Diagnostic -> () #

Eq Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

Ord Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic

type Rep Diagnostic 
Instance details

Defined in Language.LSP.Types.Diagnostic