{- 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.DiagnosticOptions 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.Types.Common

{-|
Diagnostic options.

@since 3.17.0
-}
data DiagnosticOptions = DiagnosticOptions 
  { {-|

  -}
  DiagnosticOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  An optional identifier under which the diagnostics are
  managed by the client.
  -}
  DiagnosticOptions -> Maybe Text
_identifier :: (Maybe Data.Text.Text)
  , {-|
  Whether the language has inter file dependencies meaning that
  editing code in one file can result in a different diagnostic
  set in another file. Inter file dependencies are common for
  most programming languages and typically uncommon for linters.
  -}
  DiagnosticOptions -> Bool
_interFileDependencies :: Bool
  , {-|
  The server provides support for workspace diagnostics as well.
  -}
  DiagnosticOptions -> Bool
_workspaceDiagnostics :: Bool
  }
  deriving stock (Int -> DiagnosticOptions -> ShowS
[DiagnosticOptions] -> ShowS
DiagnosticOptions -> String
(Int -> DiagnosticOptions -> ShowS)
-> (DiagnosticOptions -> String)
-> ([DiagnosticOptions] -> ShowS)
-> Show DiagnosticOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticOptions -> ShowS
showsPrec :: Int -> DiagnosticOptions -> ShowS
$cshow :: DiagnosticOptions -> String
show :: DiagnosticOptions -> String
$cshowList :: [DiagnosticOptions] -> ShowS
showList :: [DiagnosticOptions] -> ShowS
Show, DiagnosticOptions -> DiagnosticOptions -> Bool
(DiagnosticOptions -> DiagnosticOptions -> Bool)
-> (DiagnosticOptions -> DiagnosticOptions -> Bool)
-> Eq DiagnosticOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiagnosticOptions -> DiagnosticOptions -> Bool
== :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c/= :: DiagnosticOptions -> DiagnosticOptions -> Bool
/= :: DiagnosticOptions -> DiagnosticOptions -> Bool
Eq, Eq DiagnosticOptions
Eq DiagnosticOptions =>
(DiagnosticOptions -> DiagnosticOptions -> Ordering)
-> (DiagnosticOptions -> DiagnosticOptions -> Bool)
-> (DiagnosticOptions -> DiagnosticOptions -> Bool)
-> (DiagnosticOptions -> DiagnosticOptions -> Bool)
-> (DiagnosticOptions -> DiagnosticOptions -> Bool)
-> (DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions)
-> (DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions)
-> Ord DiagnosticOptions
DiagnosticOptions -> DiagnosticOptions -> Bool
DiagnosticOptions -> DiagnosticOptions -> Ordering
DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
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 :: DiagnosticOptions -> DiagnosticOptions -> Ordering
compare :: DiagnosticOptions -> DiagnosticOptions -> Ordering
$c< :: DiagnosticOptions -> DiagnosticOptions -> Bool
< :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c<= :: DiagnosticOptions -> DiagnosticOptions -> Bool
<= :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c> :: DiagnosticOptions -> DiagnosticOptions -> Bool
> :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c>= :: DiagnosticOptions -> DiagnosticOptions -> Bool
>= :: DiagnosticOptions -> DiagnosticOptions -> Bool
$cmax :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
max :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
$cmin :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
min :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
Ord, (forall x. DiagnosticOptions -> Rep DiagnosticOptions x)
-> (forall x. Rep DiagnosticOptions x -> DiagnosticOptions)
-> Generic DiagnosticOptions
forall x. Rep DiagnosticOptions x -> DiagnosticOptions
forall x. DiagnosticOptions -> Rep DiagnosticOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DiagnosticOptions -> Rep DiagnosticOptions x
from :: forall x. DiagnosticOptions -> Rep DiagnosticOptions x
$cto :: forall x. Rep DiagnosticOptions x -> DiagnosticOptions
to :: forall x. Rep DiagnosticOptions x -> DiagnosticOptions
Generic)
  deriving anyclass (DiagnosticOptions -> ()
(DiagnosticOptions -> ()) -> NFData DiagnosticOptions
forall a. (a -> ()) -> NFData a
$crnf :: DiagnosticOptions -> ()
rnf :: DiagnosticOptions -> ()
NFData, Eq DiagnosticOptions
Eq DiagnosticOptions =>
(Int -> DiagnosticOptions -> Int)
-> (DiagnosticOptions -> Int) -> Hashable DiagnosticOptions
Int -> DiagnosticOptions -> Int
DiagnosticOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DiagnosticOptions -> Int
hashWithSalt :: Int -> DiagnosticOptions -> Int
$chash :: DiagnosticOptions -> Int
hash :: DiagnosticOptions -> Int
Hashable)
  deriving (forall ann. DiagnosticOptions -> Doc ann)
-> (forall ann. [DiagnosticOptions] -> Doc ann)
-> Pretty DiagnosticOptions
forall ann. [DiagnosticOptions] -> Doc ann
forall ann. DiagnosticOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DiagnosticOptions -> Doc ann
pretty :: forall ann. DiagnosticOptions -> Doc ann
$cprettyList :: forall ann. [DiagnosticOptions] -> Doc ann
prettyList :: forall ann. [DiagnosticOptions] -> Doc ann
Pretty via (ViaJSON DiagnosticOptions)

instance Aeson.ToJSON DiagnosticOptions where
  toJSON :: DiagnosticOptions -> Value
toJSON (DiagnosticOptions Maybe Bool
arg0 Maybe Text
arg1 Bool
arg2 Bool
arg3) = [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
$  [String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"identifier" 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
"interFileDependencies" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg2]
    ,[Key
"workspaceDiagnostics" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg3]]

instance Aeson.FromJSON DiagnosticOptions where
  parseJSON :: Value -> Parser DiagnosticOptions
parseJSON = String
-> (Object -> Parser DiagnosticOptions)
-> Value
-> Parser DiagnosticOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DiagnosticOptions" ((Object -> Parser DiagnosticOptions)
 -> Value -> Parser DiagnosticOptions)
-> (Object -> Parser DiagnosticOptions)
-> Value
-> Parser DiagnosticOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Text -> Bool -> Bool -> DiagnosticOptions
DiagnosticOptions (Maybe Bool -> Maybe Text -> Bool -> Bool -> DiagnosticOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Bool -> Bool -> DiagnosticOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser (Maybe Text -> Bool -> Bool -> DiagnosticOptions)
-> Parser (Maybe Text)
-> Parser (Bool -> Bool -> DiagnosticOptions)
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
"identifier" Parser (Bool -> Bool -> DiagnosticOptions)
-> Parser Bool -> Parser (Bool -> DiagnosticOptions)
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 Bool
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"interFileDependencies" Parser (Bool -> DiagnosticOptions)
-> Parser Bool -> Parser DiagnosticOptions
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 Bool
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"workspaceDiagnostics"