{- 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.PublishDiagnosticsClientCapabilities 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 as Row
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.DiagnosticTag
import qualified Language.LSP.Protocol.Types.Common

{-|
The publish diagnostic client capabilities.
-}
data PublishDiagnosticsClientCapabilities = PublishDiagnosticsClientCapabilities 
  { {-|
  Whether the clients accepts diagnostics with related information.
  -}
  PublishDiagnosticsClientCapabilities -> Maybe Bool
_relatedInformation :: (Maybe Bool)
  , {-|
  Client supports the tag property to provide meta data about a diagnostic.
  Clients supporting tags have to handle unknown tags gracefully.

  @since 3.15.0
  -}
  PublishDiagnosticsClientCapabilities
-> Maybe
     (Rec (Extend "valueSet" [DiagnosticTag] ('R '[]) .+ 'R '[]))
_tagSupport :: (Maybe (Row.Rec ("valueSet" Row..== [Language.LSP.Protocol.Internal.Types.DiagnosticTag.DiagnosticTag] Row..+ Row.Empty)))
  , {-|
  Whether the client interprets the version property of the
  `textDocument/publishDiagnostics` notification's parameter.

  @since 3.15.0
  -}
  PublishDiagnosticsClientCapabilities -> Maybe Bool
_versionSupport :: (Maybe Bool)
  , {-|
  Client supports a codeDescription property

  @since 3.16.0
  -}
  PublishDiagnosticsClientCapabilities -> Maybe Bool
_codeDescriptionSupport :: (Maybe Bool)
  , {-|
  Whether code action supports the `data` property which is
  preserved between a `textDocument/publishDiagnostics` and
  `textDocument/codeAction` request.

  @since 3.16.0
  -}
  PublishDiagnosticsClientCapabilities -> Maybe Bool
_dataSupport :: (Maybe Bool)
  }
  deriving stock (Int -> PublishDiagnosticsClientCapabilities -> ShowS
[PublishDiagnosticsClientCapabilities] -> ShowS
PublishDiagnosticsClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishDiagnosticsClientCapabilities] -> ShowS
$cshowList :: [PublishDiagnosticsClientCapabilities] -> ShowS
show :: PublishDiagnosticsClientCapabilities -> String
$cshow :: PublishDiagnosticsClientCapabilities -> String
showsPrec :: Int -> PublishDiagnosticsClientCapabilities -> ShowS
$cshowsPrec :: Int -> PublishDiagnosticsClientCapabilities -> ShowS
Show, PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c/= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
== :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c== :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
Eq, Eq PublishDiagnosticsClientCapabilities
PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Ordering
PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
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
min :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
$cmin :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
max :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
$cmax :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities
>= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c>= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
> :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c> :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
<= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c<= :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
< :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
$c< :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Bool
compare :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Ordering
$ccompare :: PublishDiagnosticsClientCapabilities
-> PublishDiagnosticsClientCapabilities -> Ordering
Ord, forall x.
Rep PublishDiagnosticsClientCapabilities x
-> PublishDiagnosticsClientCapabilities
forall x.
PublishDiagnosticsClientCapabilities
-> Rep PublishDiagnosticsClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublishDiagnosticsClientCapabilities x
-> PublishDiagnosticsClientCapabilities
$cfrom :: forall x.
PublishDiagnosticsClientCapabilities
-> Rep PublishDiagnosticsClientCapabilities x
Generic)
  deriving anyclass (PublishDiagnosticsClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: PublishDiagnosticsClientCapabilities -> ()
$crnf :: PublishDiagnosticsClientCapabilities -> ()
NFData, Eq PublishDiagnosticsClientCapabilities
Int -> PublishDiagnosticsClientCapabilities -> Int
PublishDiagnosticsClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PublishDiagnosticsClientCapabilities -> Int
$chash :: PublishDiagnosticsClientCapabilities -> Int
hashWithSalt :: Int -> PublishDiagnosticsClientCapabilities -> Int
$chashWithSalt :: Int -> PublishDiagnosticsClientCapabilities -> Int
Hashable)
  deriving forall ann. [PublishDiagnosticsClientCapabilities] -> Doc ann
forall ann. PublishDiagnosticsClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [PublishDiagnosticsClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [PublishDiagnosticsClientCapabilities] -> Doc ann
pretty :: forall ann. PublishDiagnosticsClientCapabilities -> Doc ann
$cpretty :: forall ann. PublishDiagnosticsClientCapabilities -> Doc ann
Pretty via (ViaJSON PublishDiagnosticsClientCapabilities)

instance Aeson.ToJSON PublishDiagnosticsClientCapabilities where
  toJSON :: PublishDiagnosticsClientCapabilities -> Value
toJSON (PublishDiagnosticsClientCapabilities Maybe Bool
arg0 Maybe (Rec (Extend "valueSet" [DiagnosticTag] ('R '[]) .+ 'R '[]))
arg1 Maybe Bool
arg2 Maybe Bool
arg3 Maybe Bool
arg4) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [String
"relatedInformation" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"tagSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Rec (Extend "valueSet" [DiagnosticTag] ('R '[]) .+ 'R '[]))
arg1
    ,String
"versionSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg2
    ,String
"codeDescriptionSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg3
    ,String
"dataSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg4]

instance Aeson.FromJSON PublishDiagnosticsClientCapabilities where
  parseJSON :: Value -> Parser PublishDiagnosticsClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"PublishDiagnosticsClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe
     (Rec (Extend "valueSet" [DiagnosticTag] ('R '[]) .+ 'R '[]))
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PublishDiagnosticsClientCapabilities
PublishDiagnosticsClientCapabilities forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"relatedInformation" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"tagSupport" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"versionSupport" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"codeDescriptionSupport" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"dataSupport"