{- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiagnosticOptions] -> ShowS
$cshowList :: [DiagnosticOptions] -> ShowS
show :: DiagnosticOptions -> String
$cshow :: DiagnosticOptions -> String
showsPrec :: Int -> DiagnosticOptions -> ShowS
$cshowsPrec :: Int -> DiagnosticOptions -> ShowS
Show, DiagnosticOptions -> DiagnosticOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c/= :: DiagnosticOptions -> DiagnosticOptions -> Bool
== :: DiagnosticOptions -> DiagnosticOptions -> Bool
$c== :: DiagnosticOptions -> DiagnosticOptions -> Bool
Eq, Eq 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
min :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
$cmin :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
max :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
$cmax :: DiagnosticOptions -> DiagnosticOptions -> DiagnosticOptions
>= :: DiagnosticOptions -> DiagnosticOptions -> Bool
$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
compare :: DiagnosticOptions -> DiagnosticOptions -> Ordering
$ccompare :: DiagnosticOptions -> DiagnosticOptions -> Ordering
Ord, 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
$cto :: forall x. Rep DiagnosticOptions x -> DiagnosticOptions
$cfrom :: forall x. DiagnosticOptions -> Rep DiagnosticOptions x
Generic)
  deriving anyclass (DiagnosticOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: DiagnosticOptions -> ()
$crnf :: DiagnosticOptions -> ()
NFData, Eq DiagnosticOptions
Int -> DiagnosticOptions -> Int
DiagnosticOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DiagnosticOptions -> Int
$chash :: DiagnosticOptions -> Int
hashWithSalt :: Int -> DiagnosticOptions -> Int
$chashWithSalt :: Int -> DiagnosticOptions -> Int
Hashable)
  deriving forall ann. [DiagnosticOptions] -> Doc ann
forall ann. DiagnosticOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DiagnosticOptions] -> Doc ann
$cprettyList :: forall ann. [DiagnosticOptions] -> Doc ann
pretty :: forall ann. DiagnosticOptions -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"identifier" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,[Key
"interFileDependencies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg2]
    ,[Key
"workspaceDiagnostics" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg3]]

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