{-# LANGUAGE DuplicateRecordFields      #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE TypeOperators              #-}

module Language.LSP.Types.Diagnostic where

import           Control.DeepSeq
import qualified Data.Aeson                                 as A
import           Data.Aeson.TH
import           Data.Text
import           GHC.Generics hiding (UInt)
import           Language.LSP.Types.Common
import           Language.LSP.Types.Location
import           Language.LSP.Types.Uri
import           Language.LSP.Types.Utils

-- ---------------------------------------------------------------------

data DiagnosticSeverity
  = DsError   -- ^ Error = 1,
  | DsWarning -- ^ Warning = 2,
  | DsInfo    -- ^ Info = 3,
  | DsHint    -- ^ Hint = 4
  deriving (DiagnosticSeverity -> DiagnosticSeverity -> Bool
(DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> (DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> Eq DiagnosticSeverity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
== :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
$c/= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
/= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
Eq,Eq DiagnosticSeverity
Eq DiagnosticSeverity =>
(DiagnosticSeverity -> DiagnosticSeverity -> Ordering)
-> (DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> (DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> (DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> (DiagnosticSeverity -> DiagnosticSeverity -> Bool)
-> (DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity)
-> (DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity)
-> Ord DiagnosticSeverity
DiagnosticSeverity -> DiagnosticSeverity -> Bool
DiagnosticSeverity -> DiagnosticSeverity -> Ordering
DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DiagnosticSeverity -> DiagnosticSeverity -> Ordering
compare :: DiagnosticSeverity -> DiagnosticSeverity -> Ordering
$c< :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
< :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
$c<= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
<= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
$c> :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
> :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
$c>= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
>= :: DiagnosticSeverity -> DiagnosticSeverity -> Bool
$cmax :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity
max :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity
$cmin :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity
min :: DiagnosticSeverity -> DiagnosticSeverity -> DiagnosticSeverity
Ord,Int -> DiagnosticSeverity -> ShowS
[DiagnosticSeverity] -> ShowS
DiagnosticSeverity -> String
(Int -> DiagnosticSeverity -> ShowS)
-> (DiagnosticSeverity -> String)
-> ([DiagnosticSeverity] -> ShowS)
-> Show DiagnosticSeverity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticSeverity -> ShowS
showsPrec :: Int -> DiagnosticSeverity -> ShowS
$cshow :: DiagnosticSeverity -> String
show :: DiagnosticSeverity -> String
$cshowList :: [DiagnosticSeverity] -> ShowS
showList :: [DiagnosticSeverity] -> ShowS
Show,ReadPrec [DiagnosticSeverity]
ReadPrec DiagnosticSeverity
Int -> ReadS DiagnosticSeverity
ReadS [DiagnosticSeverity]
(Int -> ReadS DiagnosticSeverity)
-> ReadS [DiagnosticSeverity]
-> ReadPrec DiagnosticSeverity
-> ReadPrec [DiagnosticSeverity]
-> Read DiagnosticSeverity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DiagnosticSeverity
readsPrec :: Int -> ReadS DiagnosticSeverity
$creadList :: ReadS [DiagnosticSeverity]
readList :: ReadS [DiagnosticSeverity]
$creadPrec :: ReadPrec DiagnosticSeverity
readPrec :: ReadPrec DiagnosticSeverity
$creadListPrec :: ReadPrec [DiagnosticSeverity]
readListPrec :: ReadPrec [DiagnosticSeverity]
Read, (forall x. DiagnosticSeverity -> Rep DiagnosticSeverity x)
-> (forall x. Rep DiagnosticSeverity x -> DiagnosticSeverity)
-> Generic DiagnosticSeverity
forall x. Rep DiagnosticSeverity x -> DiagnosticSeverity
forall x. DiagnosticSeverity -> Rep DiagnosticSeverity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DiagnosticSeverity -> Rep DiagnosticSeverity x
from :: forall x. DiagnosticSeverity -> Rep DiagnosticSeverity x
$cto :: forall x. Rep DiagnosticSeverity x -> DiagnosticSeverity
to :: forall x. Rep DiagnosticSeverity x -> DiagnosticSeverity
Generic)

instance NFData DiagnosticSeverity

instance A.ToJSON DiagnosticSeverity where
  toJSON :: DiagnosticSeverity -> Value
toJSON DiagnosticSeverity
DsError   = Scientific -> Value
A.Number Scientific
1
  toJSON DiagnosticSeverity
DsWarning = Scientific -> Value
A.Number Scientific
2
  toJSON DiagnosticSeverity
DsInfo    = Scientific -> Value
A.Number Scientific
3
  toJSON DiagnosticSeverity
DsHint    = Scientific -> Value
A.Number Scientific
4

instance A.FromJSON DiagnosticSeverity where
  parseJSON :: Value -> Parser DiagnosticSeverity
parseJSON (A.Number Scientific
1) = DiagnosticSeverity -> Parser DiagnosticSeverity
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticSeverity
DsError
  parseJSON (A.Number Scientific
2) = DiagnosticSeverity -> Parser DiagnosticSeverity
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticSeverity
DsWarning
  parseJSON (A.Number Scientific
3) = DiagnosticSeverity -> Parser DiagnosticSeverity
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticSeverity
DsInfo
  parseJSON (A.Number Scientific
4) = DiagnosticSeverity -> Parser DiagnosticSeverity
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticSeverity
DsHint
  parseJSON Value
_            = String -> Parser DiagnosticSeverity
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"DiagnosticSeverity"

data DiagnosticTag
  -- | Unused or unnecessary code.
  --
  -- Clients are allowed to render diagnostics with this tag faded out
  -- instead of having an error squiggle.
  = DtUnnecessary
  -- | Deprecated or obsolete code.
  --
  -- Clients are allowed to rendered diagnostics with this tag strike
  -- through.
  | DtDeprecated
  deriving (DiagnosticTag -> DiagnosticTag -> Bool
(DiagnosticTag -> DiagnosticTag -> Bool)
-> (DiagnosticTag -> DiagnosticTag -> Bool) -> Eq DiagnosticTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiagnosticTag -> DiagnosticTag -> Bool
== :: DiagnosticTag -> DiagnosticTag -> Bool
$c/= :: DiagnosticTag -> DiagnosticTag -> Bool
/= :: DiagnosticTag -> DiagnosticTag -> Bool
Eq, Eq DiagnosticTag
Eq DiagnosticTag =>
(DiagnosticTag -> DiagnosticTag -> Ordering)
-> (DiagnosticTag -> DiagnosticTag -> Bool)
-> (DiagnosticTag -> DiagnosticTag -> Bool)
-> (DiagnosticTag -> DiagnosticTag -> Bool)
-> (DiagnosticTag -> DiagnosticTag -> Bool)
-> (DiagnosticTag -> DiagnosticTag -> DiagnosticTag)
-> (DiagnosticTag -> DiagnosticTag -> DiagnosticTag)
-> Ord DiagnosticTag
DiagnosticTag -> DiagnosticTag -> Bool
DiagnosticTag -> DiagnosticTag -> Ordering
DiagnosticTag -> DiagnosticTag -> DiagnosticTag
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DiagnosticTag -> DiagnosticTag -> Ordering
compare :: DiagnosticTag -> DiagnosticTag -> Ordering
$c< :: DiagnosticTag -> DiagnosticTag -> Bool
< :: DiagnosticTag -> DiagnosticTag -> Bool
$c<= :: DiagnosticTag -> DiagnosticTag -> Bool
<= :: DiagnosticTag -> DiagnosticTag -> Bool
$c> :: DiagnosticTag -> DiagnosticTag -> Bool
> :: DiagnosticTag -> DiagnosticTag -> Bool
$c>= :: DiagnosticTag -> DiagnosticTag -> Bool
>= :: DiagnosticTag -> DiagnosticTag -> Bool
$cmax :: DiagnosticTag -> DiagnosticTag -> DiagnosticTag
max :: DiagnosticTag -> DiagnosticTag -> DiagnosticTag
$cmin :: DiagnosticTag -> DiagnosticTag -> DiagnosticTag
min :: DiagnosticTag -> DiagnosticTag -> DiagnosticTag
Ord, Int -> DiagnosticTag -> ShowS
[DiagnosticTag] -> ShowS
DiagnosticTag -> String
(Int -> DiagnosticTag -> ShowS)
-> (DiagnosticTag -> String)
-> ([DiagnosticTag] -> ShowS)
-> Show DiagnosticTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticTag -> ShowS
showsPrec :: Int -> DiagnosticTag -> ShowS
$cshow :: DiagnosticTag -> String
show :: DiagnosticTag -> String
$cshowList :: [DiagnosticTag] -> ShowS
showList :: [DiagnosticTag] -> ShowS
Show, ReadPrec [DiagnosticTag]
ReadPrec DiagnosticTag
Int -> ReadS DiagnosticTag
ReadS [DiagnosticTag]
(Int -> ReadS DiagnosticTag)
-> ReadS [DiagnosticTag]
-> ReadPrec DiagnosticTag
-> ReadPrec [DiagnosticTag]
-> Read DiagnosticTag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DiagnosticTag
readsPrec :: Int -> ReadS DiagnosticTag
$creadList :: ReadS [DiagnosticTag]
readList :: ReadS [DiagnosticTag]
$creadPrec :: ReadPrec DiagnosticTag
readPrec :: ReadPrec DiagnosticTag
$creadListPrec :: ReadPrec [DiagnosticTag]
readListPrec :: ReadPrec [DiagnosticTag]
Read, (forall x. DiagnosticTag -> Rep DiagnosticTag x)
-> (forall x. Rep DiagnosticTag x -> DiagnosticTag)
-> Generic DiagnosticTag
forall x. Rep DiagnosticTag x -> DiagnosticTag
forall x. DiagnosticTag -> Rep DiagnosticTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DiagnosticTag -> Rep DiagnosticTag x
from :: forall x. DiagnosticTag -> Rep DiagnosticTag x
$cto :: forall x. Rep DiagnosticTag x -> DiagnosticTag
to :: forall x. Rep DiagnosticTag x -> DiagnosticTag
Generic)

instance NFData DiagnosticTag

instance A.ToJSON DiagnosticTag where
  toJSON :: DiagnosticTag -> Value
toJSON DiagnosticTag
DtUnnecessary = Scientific -> Value
A.Number Scientific
1
  toJSON DiagnosticTag
DtDeprecated  = Scientific -> Value
A.Number Scientific
2

instance A.FromJSON DiagnosticTag where
  parseJSON :: Value -> Parser DiagnosticTag
parseJSON (A.Number Scientific
1) = DiagnosticTag -> Parser DiagnosticTag
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticTag
DtUnnecessary
  parseJSON (A.Number Scientific
2) = DiagnosticTag -> Parser DiagnosticTag
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DiagnosticTag
DtDeprecated
  parseJSON Value
_            = String -> Parser DiagnosticTag
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"DiagnosticTag"

-- ---------------------------------------------------------------------

data DiagnosticRelatedInformation =
  DiagnosticRelatedInformation
    { DiagnosticRelatedInformation -> Location
_location :: Location
    , DiagnosticRelatedInformation -> Text
_message  :: Text
    } deriving (Int -> DiagnosticRelatedInformation -> ShowS
[DiagnosticRelatedInformation] -> ShowS
DiagnosticRelatedInformation -> String
(Int -> DiagnosticRelatedInformation -> ShowS)
-> (DiagnosticRelatedInformation -> String)
-> ([DiagnosticRelatedInformation] -> ShowS)
-> Show DiagnosticRelatedInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticRelatedInformation -> ShowS
showsPrec :: Int -> DiagnosticRelatedInformation -> ShowS
$cshow :: DiagnosticRelatedInformation -> String
show :: DiagnosticRelatedInformation -> String
$cshowList :: [DiagnosticRelatedInformation] -> ShowS
showList :: [DiagnosticRelatedInformation] -> ShowS
Show, ReadPrec [DiagnosticRelatedInformation]
ReadPrec DiagnosticRelatedInformation
Int -> ReadS DiagnosticRelatedInformation
ReadS [DiagnosticRelatedInformation]
(Int -> ReadS DiagnosticRelatedInformation)
-> ReadS [DiagnosticRelatedInformation]
-> ReadPrec DiagnosticRelatedInformation
-> ReadPrec [DiagnosticRelatedInformation]
-> Read DiagnosticRelatedInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS DiagnosticRelatedInformation
readsPrec :: Int -> ReadS DiagnosticRelatedInformation
$creadList :: ReadS [DiagnosticRelatedInformation]
readList :: ReadS [DiagnosticRelatedInformation]
$creadPrec :: ReadPrec DiagnosticRelatedInformation
readPrec :: ReadPrec DiagnosticRelatedInformation
$creadListPrec :: ReadPrec [DiagnosticRelatedInformation]
readListPrec :: ReadPrec [DiagnosticRelatedInformation]
Read, DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
(DiagnosticRelatedInformation
 -> DiagnosticRelatedInformation -> Bool)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> Bool)
-> Eq DiagnosticRelatedInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
== :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
$c/= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
/= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
Eq, Eq DiagnosticRelatedInformation
Eq DiagnosticRelatedInformation =>
(DiagnosticRelatedInformation
 -> DiagnosticRelatedInformation -> Ordering)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> Bool)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> Bool)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> Bool)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> Bool)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> DiagnosticRelatedInformation)
-> (DiagnosticRelatedInformation
    -> DiagnosticRelatedInformation -> DiagnosticRelatedInformation)
-> Ord DiagnosticRelatedInformation
DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Ordering
DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> DiagnosticRelatedInformation
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Ordering
compare :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Ordering
$c< :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
< :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
$c<= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
<= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
$c> :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
> :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
$c>= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
>= :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> Bool
$cmax :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> DiagnosticRelatedInformation
max :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> DiagnosticRelatedInformation
$cmin :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> DiagnosticRelatedInformation
min :: DiagnosticRelatedInformation
-> DiagnosticRelatedInformation -> DiagnosticRelatedInformation
Ord, (forall x.
 DiagnosticRelatedInformation -> Rep DiagnosticRelatedInformation x)
-> (forall x.
    Rep DiagnosticRelatedInformation x -> DiagnosticRelatedInformation)
-> Generic DiagnosticRelatedInformation
forall x.
Rep DiagnosticRelatedInformation x -> DiagnosticRelatedInformation
forall x.
DiagnosticRelatedInformation -> Rep DiagnosticRelatedInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DiagnosticRelatedInformation -> Rep DiagnosticRelatedInformation x
from :: forall x.
DiagnosticRelatedInformation -> Rep DiagnosticRelatedInformation x
$cto :: forall x.
Rep DiagnosticRelatedInformation x -> DiagnosticRelatedInformation
to :: forall x.
Rep DiagnosticRelatedInformation x -> DiagnosticRelatedInformation
Generic)

instance NFData DiagnosticRelatedInformation

deriveJSON lspOptions ''DiagnosticRelatedInformation

-- ---------------------------------------------------------------------

type DiagnosticSource = Text
data Diagnostic =
  Diagnostic
    { Diagnostic -> Range
_range              :: Range
    , Diagnostic -> Maybe DiagnosticSeverity
_severity           :: Maybe DiagnosticSeverity
    , Diagnostic -> Maybe (Int32 |? Text)
_code               :: Maybe (Int32 |? Text)
    , Diagnostic -> Maybe Text
_source             :: Maybe DiagnosticSource
    , Diagnostic -> Text
_message            :: Text
    , Diagnostic -> Maybe (List DiagnosticTag)
_tags               :: Maybe (List DiagnosticTag)
    , Diagnostic -> Maybe (List DiagnosticRelatedInformation)
_relatedInformation :: Maybe (List DiagnosticRelatedInformation)
    } deriving (Int -> Diagnostic -> ShowS
[Diagnostic] -> ShowS
Diagnostic -> String
(Int -> Diagnostic -> ShowS)
-> (Diagnostic -> String)
-> ([Diagnostic] -> ShowS)
-> Show Diagnostic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Diagnostic -> ShowS
showsPrec :: Int -> Diagnostic -> ShowS
$cshow :: Diagnostic -> String
show :: Diagnostic -> String
$cshowList :: [Diagnostic] -> ShowS
showList :: [Diagnostic] -> ShowS
Show, ReadPrec [Diagnostic]
ReadPrec Diagnostic
Int -> ReadS Diagnostic
ReadS [Diagnostic]
(Int -> ReadS Diagnostic)
-> ReadS [Diagnostic]
-> ReadPrec Diagnostic
-> ReadPrec [Diagnostic]
-> Read Diagnostic
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Diagnostic
readsPrec :: Int -> ReadS Diagnostic
$creadList :: ReadS [Diagnostic]
readList :: ReadS [Diagnostic]
$creadPrec :: ReadPrec Diagnostic
readPrec :: ReadPrec Diagnostic
$creadListPrec :: ReadPrec [Diagnostic]
readListPrec :: ReadPrec [Diagnostic]
Read, Diagnostic -> Diagnostic -> Bool
(Diagnostic -> Diagnostic -> Bool)
-> (Diagnostic -> Diagnostic -> Bool) -> Eq Diagnostic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Diagnostic -> Diagnostic -> Bool
== :: Diagnostic -> Diagnostic -> Bool
$c/= :: Diagnostic -> Diagnostic -> Bool
/= :: Diagnostic -> Diagnostic -> Bool
Eq, Eq Diagnostic
Eq Diagnostic =>
(Diagnostic -> Diagnostic -> Ordering)
-> (Diagnostic -> Diagnostic -> Bool)
-> (Diagnostic -> Diagnostic -> Bool)
-> (Diagnostic -> Diagnostic -> Bool)
-> (Diagnostic -> Diagnostic -> Bool)
-> (Diagnostic -> Diagnostic -> Diagnostic)
-> (Diagnostic -> Diagnostic -> Diagnostic)
-> Ord Diagnostic
Diagnostic -> Diagnostic -> Bool
Diagnostic -> Diagnostic -> Ordering
Diagnostic -> Diagnostic -> Diagnostic
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Diagnostic -> Diagnostic -> Ordering
compare :: Diagnostic -> Diagnostic -> Ordering
$c< :: Diagnostic -> Diagnostic -> Bool
< :: Diagnostic -> Diagnostic -> Bool
$c<= :: Diagnostic -> Diagnostic -> Bool
<= :: Diagnostic -> Diagnostic -> Bool
$c> :: Diagnostic -> Diagnostic -> Bool
> :: Diagnostic -> Diagnostic -> Bool
$c>= :: Diagnostic -> Diagnostic -> Bool
>= :: Diagnostic -> Diagnostic -> Bool
$cmax :: Diagnostic -> Diagnostic -> Diagnostic
max :: Diagnostic -> Diagnostic -> Diagnostic
$cmin :: Diagnostic -> Diagnostic -> Diagnostic
min :: Diagnostic -> Diagnostic -> Diagnostic
Ord, (forall x. Diagnostic -> Rep Diagnostic x)
-> (forall x. Rep Diagnostic x -> Diagnostic) -> Generic Diagnostic
forall x. Rep Diagnostic x -> Diagnostic
forall x. Diagnostic -> Rep Diagnostic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Diagnostic -> Rep Diagnostic x
from :: forall x. Diagnostic -> Rep Diagnostic x
$cto :: forall x. Rep Diagnostic x -> Diagnostic
to :: forall x. Rep Diagnostic x -> Diagnostic
Generic)

instance NFData Diagnostic

deriveJSON lspOptions ''Diagnostic

-- -------------------------------------

data PublishDiagnosticsTagsClientCapabilities =
  PublishDiagnosticsTagsClientCapabilities
    { -- | The tags supported by the client.
      PublishDiagnosticsTagsClientCapabilities -> List DiagnosticTag
_valueSet :: List DiagnosticTag
    } deriving (Int -> PublishDiagnosticsTagsClientCapabilities -> ShowS
[PublishDiagnosticsTagsClientCapabilities] -> ShowS
PublishDiagnosticsTagsClientCapabilities -> String
(Int -> PublishDiagnosticsTagsClientCapabilities -> ShowS)
-> (PublishDiagnosticsTagsClientCapabilities -> String)
-> ([PublishDiagnosticsTagsClientCapabilities] -> ShowS)
-> Show PublishDiagnosticsTagsClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PublishDiagnosticsTagsClientCapabilities -> ShowS
showsPrec :: Int -> PublishDiagnosticsTagsClientCapabilities -> ShowS
$cshow :: PublishDiagnosticsTagsClientCapabilities -> String
show :: PublishDiagnosticsTagsClientCapabilities -> String
$cshowList :: [PublishDiagnosticsTagsClientCapabilities] -> ShowS
showList :: [PublishDiagnosticsTagsClientCapabilities] -> ShowS
Show, ReadPrec [PublishDiagnosticsTagsClientCapabilities]
ReadPrec PublishDiagnosticsTagsClientCapabilities
Int -> ReadS PublishDiagnosticsTagsClientCapabilities
ReadS [PublishDiagnosticsTagsClientCapabilities]
(Int -> ReadS PublishDiagnosticsTagsClientCapabilities)
-> ReadS [PublishDiagnosticsTagsClientCapabilities]
-> ReadPrec PublishDiagnosticsTagsClientCapabilities
-> ReadPrec [PublishDiagnosticsTagsClientCapabilities]
-> Read PublishDiagnosticsTagsClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS PublishDiagnosticsTagsClientCapabilities
readsPrec :: Int -> ReadS PublishDiagnosticsTagsClientCapabilities
$creadList :: ReadS [PublishDiagnosticsTagsClientCapabilities]
readList :: ReadS [PublishDiagnosticsTagsClientCapabilities]
$creadPrec :: ReadPrec PublishDiagnosticsTagsClientCapabilities
readPrec :: ReadPrec PublishDiagnosticsTagsClientCapabilities
$creadListPrec :: ReadPrec [PublishDiagnosticsTagsClientCapabilities]
readListPrec :: ReadPrec [PublishDiagnosticsTagsClientCapabilities]
Read, PublishDiagnosticsTagsClientCapabilities
-> PublishDiagnosticsTagsClientCapabilities -> Bool
(PublishDiagnosticsTagsClientCapabilities
 -> PublishDiagnosticsTagsClientCapabilities -> Bool)
-> (PublishDiagnosticsTagsClientCapabilities
    -> PublishDiagnosticsTagsClientCapabilities -> Bool)
-> Eq PublishDiagnosticsTagsClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PublishDiagnosticsTagsClientCapabilities
-> PublishDiagnosticsTagsClientCapabilities -> Bool
== :: PublishDiagnosticsTagsClientCapabilities
-> PublishDiagnosticsTagsClientCapabilities -> Bool
$c/= :: PublishDiagnosticsTagsClientCapabilities
-> PublishDiagnosticsTagsClientCapabilities -> Bool
/= :: PublishDiagnosticsTagsClientCapabilities
-> PublishDiagnosticsTagsClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''PublishDiagnosticsTagsClientCapabilities

data PublishDiagnosticsClientCapabilities =
  PublishDiagnosticsClientCapabilities
    { -- | Whether the clients accepts diagnostics with related information.
      PublishDiagnosticsClientCapabilities -> Maybe Bool
_relatedInformation :: Maybe Bool
      -- | Client supports the tag property to provide metadata about a
      -- diagnostic.
      --
      -- Clients supporting tags have to handle unknown tags gracefully.
      -- 
      -- Since LSP 3.15.0
    , PublishDiagnosticsClientCapabilities
-> Maybe PublishDiagnosticsTagsClientCapabilities
_tagSupport :: Maybe PublishDiagnosticsTagsClientCapabilities
      -- | Whether the client interprets the version property of the
      -- @textDocument/publishDiagnostics@ notification's parameter.
      -- 
      -- Since LSP 3.15.0
    , PublishDiagnosticsClientCapabilities -> Maybe Bool
_versionSupport :: Maybe Bool
    } deriving (Int -> PublishDiagnosticsClientCapabilities -> ShowS
[PublishDiagnosticsClientCapabilities] -> ShowS
PublishDiagnosticsClientCapabilities -> String
(Int -> PublishDiagnosticsClientCapabilities -> ShowS)
-> (PublishDiagnosticsClientCapabilities -> String)
-> ([PublishDiagnosticsClientCapabilities] -> ShowS)
-> Show PublishDiagnosticsClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PublishDiagnosticsClientCapabilities -> ShowS
showsPrec :: Int -> PublishDiagnosticsClientCapabilities -> ShowS
$cshow :: PublishDiagnosticsClientCapabilities -> String
show :: PublishDiagnosticsClientCapabilities -> String
$cshowList :: [PublishDiagnosticsClientCapabilities] -> ShowS
showList :: [PublishDiagnosticsClientCapabilities] -> ShowS
Show, ReadPrec [PublishDiagnosticsClientCapabilities]
ReadPrec PublishDiagnosticsClientCapabilities
Int -> ReadS PublishDiagnosticsClientCapabilities
ReadS [PublishDiagnosticsClientCapabilities]
(Int -> ReadS PublishDiagnosticsClientCapabilities)
-> ReadS [PublishDiagnosticsClientCapabilities]
-> ReadPrec PublishDiagnosticsClientCapabilities
-> ReadPrec [PublishDiagnosticsClientCapabilities]
-> Read PublishDiagnosticsClientCapabilities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS PublishDiagnosticsClientCapabilities
readsPrec :: Int -> ReadS PublishDiagnosticsClientCapabilities
$creadList :: ReadS [PublishDiagnosticsClientCapabilities]
readList :: ReadS [PublishDiagnosticsClientCapabilities]
$creadPrec :: ReadPrec PublishDiagnosticsClientCapabilities
readPrec :: ReadPrec PublishDiagnosticsClientCapabilities
$creadListPrec :: ReadPrec [PublishDiagnosticsClientCapabilities]
readListPrec :: ReadPrec [PublishDiagnosticsClientCapabilities]
Read, PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
(PublishDiagnosticsClientCapabilities
 -> PublishDiagnosticsClientCapabilities -> Bool)
-> (PublishDiagnosticsClientCapabilities
    -> PublishDiagnosticsClientCapabilities -> Bool)
-> Eq PublishDiagnosticsClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
== :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c/= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
/= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
Eq)

deriveJSON lspOptions ''PublishDiagnosticsClientCapabilities

data PublishDiagnosticsParams =
  PublishDiagnosticsParams
    { -- | The URI for which diagnostic information is reported.
      PublishDiagnosticsParams -> Uri
_uri         :: Uri
      -- | Optional the version number of the document the diagnostics are
      -- published for.
      -- 
      -- Since LSP 3.15.0
    , PublishDiagnosticsParams -> Maybe UInt
_version     :: Maybe UInt
      -- | An array of diagnostic information items.
    , PublishDiagnosticsParams -> List Diagnostic
_diagnostics :: List Diagnostic
    } deriving (ReadPrec [PublishDiagnosticsParams]
ReadPrec PublishDiagnosticsParams
Int -> ReadS PublishDiagnosticsParams
ReadS [PublishDiagnosticsParams]
(Int -> ReadS PublishDiagnosticsParams)
-> ReadS [PublishDiagnosticsParams]
-> ReadPrec PublishDiagnosticsParams
-> ReadPrec [PublishDiagnosticsParams]
-> Read PublishDiagnosticsParams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS PublishDiagnosticsParams
readsPrec :: Int -> ReadS PublishDiagnosticsParams
$creadList :: ReadS [PublishDiagnosticsParams]
readList :: ReadS [PublishDiagnosticsParams]
$creadPrec :: ReadPrec PublishDiagnosticsParams
readPrec :: ReadPrec PublishDiagnosticsParams
$creadListPrec :: ReadPrec [PublishDiagnosticsParams]
readListPrec :: ReadPrec [PublishDiagnosticsParams]
Read,Int -> PublishDiagnosticsParams -> ShowS
[PublishDiagnosticsParams] -> ShowS
PublishDiagnosticsParams -> String
(Int -> PublishDiagnosticsParams -> ShowS)
-> (PublishDiagnosticsParams -> String)
-> ([PublishDiagnosticsParams] -> ShowS)
-> Show PublishDiagnosticsParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PublishDiagnosticsParams -> ShowS
showsPrec :: Int -> PublishDiagnosticsParams -> ShowS
$cshow :: PublishDiagnosticsParams -> String
show :: PublishDiagnosticsParams -> String
$cshowList :: [PublishDiagnosticsParams] -> ShowS
showList :: [PublishDiagnosticsParams] -> ShowS
Show,PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool
(PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool)
-> (PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool)
-> Eq PublishDiagnosticsParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool
== :: PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool
$c/= :: PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool
/= :: PublishDiagnosticsParams -> PublishDiagnosticsParams -> Bool
Eq)

deriveJSON lspOptions ''PublishDiagnosticsParams