{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.FullDocumentDiagnosticReport where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Data.Text
import qualified Language.LSP.Protocol.Internal.Types.Diagnostic
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Singletons

{-|
A diagnostic report with a full set of problems.

@since 3.17.0
-}
data FullDocumentDiagnosticReport = FullDocumentDiagnosticReport 
  { {-|
  A full document diagnostic report.
  -}
  FullDocumentDiagnosticReport -> AString "full"
_kind :: (Language.LSP.Protocol.Types.Singletons.AString "full")
  , {-|
  An optional result id. If provided it will
  be sent on the next diagnostic request for the
  same document.
  -}
  FullDocumentDiagnosticReport -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The actual items.
  -}
  FullDocumentDiagnosticReport -> [Diagnostic]
_items :: [Language.LSP.Protocol.Internal.Types.Diagnostic.Diagnostic]
  }
  deriving stock (Int -> FullDocumentDiagnosticReport -> ShowS
[FullDocumentDiagnosticReport] -> ShowS
FullDocumentDiagnosticReport -> String
(Int -> FullDocumentDiagnosticReport -> ShowS)
-> (FullDocumentDiagnosticReport -> String)
-> ([FullDocumentDiagnosticReport] -> ShowS)
-> Show FullDocumentDiagnosticReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FullDocumentDiagnosticReport -> ShowS
showsPrec :: Int -> FullDocumentDiagnosticReport -> ShowS
$cshow :: FullDocumentDiagnosticReport -> String
show :: FullDocumentDiagnosticReport -> String
$cshowList :: [FullDocumentDiagnosticReport] -> ShowS
showList :: [FullDocumentDiagnosticReport] -> ShowS
Show, FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
(FullDocumentDiagnosticReport
 -> FullDocumentDiagnosticReport -> Bool)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> Bool)
-> Eq FullDocumentDiagnosticReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
== :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c/= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
/= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
Eq, Eq FullDocumentDiagnosticReport
Eq FullDocumentDiagnosticReport =>
(FullDocumentDiagnosticReport
 -> FullDocumentDiagnosticReport -> Ordering)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> Bool)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> Bool)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> Bool)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> Bool)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport)
-> (FullDocumentDiagnosticReport
    -> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport)
-> Ord FullDocumentDiagnosticReport
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
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 :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
compare :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
$c< :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
< :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c<= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
<= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c> :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
> :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c>= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
>= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$cmax :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
max :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
$cmin :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
min :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
Ord, (forall x.
 FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x)
-> (forall x.
    Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport)
-> Generic FullDocumentDiagnosticReport
forall x.
Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport
forall x.
FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x
from :: forall x.
FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x
$cto :: forall x.
Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport
to :: forall x.
Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport
Generic)
  deriving anyclass (FullDocumentDiagnosticReport -> ()
(FullDocumentDiagnosticReport -> ())
-> NFData FullDocumentDiagnosticReport
forall a. (a -> ()) -> NFData a
$crnf :: FullDocumentDiagnosticReport -> ()
rnf :: FullDocumentDiagnosticReport -> ()
NFData, Eq FullDocumentDiagnosticReport
Eq FullDocumentDiagnosticReport =>
(Int -> FullDocumentDiagnosticReport -> Int)
-> (FullDocumentDiagnosticReport -> Int)
-> Hashable FullDocumentDiagnosticReport
Int -> FullDocumentDiagnosticReport -> Int
FullDocumentDiagnosticReport -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> FullDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> FullDocumentDiagnosticReport -> Int
$chash :: FullDocumentDiagnosticReport -> Int
hash :: FullDocumentDiagnosticReport -> Int
Hashable)
  deriving (forall ann. FullDocumentDiagnosticReport -> Doc ann)
-> (forall ann. [FullDocumentDiagnosticReport] -> Doc ann)
-> Pretty FullDocumentDiagnosticReport
forall ann. [FullDocumentDiagnosticReport] -> Doc ann
forall ann. FullDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. FullDocumentDiagnosticReport -> Doc ann
pretty :: forall ann. FullDocumentDiagnosticReport -> Doc ann
$cprettyList :: forall ann. [FullDocumentDiagnosticReport] -> Doc ann
prettyList :: forall ann. [FullDocumentDiagnosticReport] -> Doc ann
Pretty via (ViaJSON FullDocumentDiagnosticReport)

instance Aeson.ToJSON FullDocumentDiagnosticReport where
  toJSON :: FullDocumentDiagnosticReport -> Value
toJSON (FullDocumentDiagnosticReport AString "full"
arg0 Maybe Text
arg1 [Diagnostic]
arg2) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"kind" Key -> AString "full" -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= AString "full"
arg0]
    ,String
"resultId" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,[Key
"items" Key -> [Diagnostic] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [Diagnostic]
arg2]]

instance Aeson.FromJSON FullDocumentDiagnosticReport where
  parseJSON :: Value -> Parser FullDocumentDiagnosticReport
parseJSON = String
-> (Object -> Parser FullDocumentDiagnosticReport)
-> Value
-> Parser FullDocumentDiagnosticReport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"FullDocumentDiagnosticReport" ((Object -> Parser FullDocumentDiagnosticReport)
 -> Value -> Parser FullDocumentDiagnosticReport)
-> (Object -> Parser FullDocumentDiagnosticReport)
-> Value
-> Parser FullDocumentDiagnosticReport
forall a b. (a -> b) -> a -> b
$ \Object
arg -> AString "full"
-> Maybe Text -> [Diagnostic] -> FullDocumentDiagnosticReport
FullDocumentDiagnosticReport (AString "full"
 -> Maybe Text -> [Diagnostic] -> FullDocumentDiagnosticReport)
-> Parser (AString "full")
-> Parser
     (Maybe Text -> [Diagnostic] -> FullDocumentDiagnosticReport)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (AString "full")
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" Parser (Maybe Text -> [Diagnostic] -> FullDocumentDiagnosticReport)
-> Parser (Maybe Text)
-> Parser ([Diagnostic] -> FullDocumentDiagnosticReport)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"resultId" Parser ([Diagnostic] -> FullDocumentDiagnosticReport)
-> Parser [Diagnostic] -> Parser FullDocumentDiagnosticReport
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser [Diagnostic]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"items"