{- 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.TextDocumentSyncOptions 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 Language.LSP.Protocol.Internal.Types.SaveOptions
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentSyncKind
import qualified Language.LSP.Protocol.Types.Common

{-|

-}
data TextDocumentSyncOptions = TextDocumentSyncOptions 
  { {-|
  Open and close notifications are sent to the server. If omitted open close notification should not
  be sent.
  -}
  TextDocumentSyncOptions -> Maybe Bool
_openClose :: (Maybe Bool)
  , {-|
  Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
  and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
  -}
  TextDocumentSyncOptions -> Maybe TextDocumentSyncKind
_change :: (Maybe Language.LSP.Protocol.Internal.Types.TextDocumentSyncKind.TextDocumentSyncKind)
  , {-|
  If present will save notifications are sent to the server. If omitted the notification should not be
  sent.
  -}
  TextDocumentSyncOptions -> Maybe Bool
_willSave :: (Maybe Bool)
  , {-|
  If present will save wait until requests are sent to the server. If omitted the request should not be
  sent.
  -}
  TextDocumentSyncOptions -> Maybe Bool
_willSaveWaitUntil :: (Maybe Bool)
  , {-|
  If present save notifications are sent to the server. If omitted the notification should not be
  sent.
  -}
  TextDocumentSyncOptions -> Maybe (Bool |? SaveOptions)
_save :: (Maybe (Bool Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.SaveOptions.SaveOptions))
  }
  deriving stock (Int -> TextDocumentSyncOptions -> ShowS
[TextDocumentSyncOptions] -> ShowS
TextDocumentSyncOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentSyncOptions] -> ShowS
$cshowList :: [TextDocumentSyncOptions] -> ShowS
show :: TextDocumentSyncOptions -> String
$cshow :: TextDocumentSyncOptions -> String
showsPrec :: Int -> TextDocumentSyncOptions -> ShowS
$cshowsPrec :: Int -> TextDocumentSyncOptions -> ShowS
Show, TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c/= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
== :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c== :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
Eq, Eq TextDocumentSyncOptions
TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
TextDocumentSyncOptions -> TextDocumentSyncOptions -> Ordering
TextDocumentSyncOptions
-> TextDocumentSyncOptions -> TextDocumentSyncOptions
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 :: TextDocumentSyncOptions
-> TextDocumentSyncOptions -> TextDocumentSyncOptions
$cmin :: TextDocumentSyncOptions
-> TextDocumentSyncOptions -> TextDocumentSyncOptions
max :: TextDocumentSyncOptions
-> TextDocumentSyncOptions -> TextDocumentSyncOptions
$cmax :: TextDocumentSyncOptions
-> TextDocumentSyncOptions -> TextDocumentSyncOptions
>= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c>= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
> :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c> :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
<= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c<= :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
< :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
$c< :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Bool
compare :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Ordering
$ccompare :: TextDocumentSyncOptions -> TextDocumentSyncOptions -> Ordering
Ord, forall x. Rep TextDocumentSyncOptions x -> TextDocumentSyncOptions
forall x. TextDocumentSyncOptions -> Rep TextDocumentSyncOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextDocumentSyncOptions x -> TextDocumentSyncOptions
$cfrom :: forall x. TextDocumentSyncOptions -> Rep TextDocumentSyncOptions x
Generic)
  deriving anyclass (TextDocumentSyncOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentSyncOptions -> ()
$crnf :: TextDocumentSyncOptions -> ()
NFData, Eq TextDocumentSyncOptions
Int -> TextDocumentSyncOptions -> Int
TextDocumentSyncOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentSyncOptions -> Int
$chash :: TextDocumentSyncOptions -> Int
hashWithSalt :: Int -> TextDocumentSyncOptions -> Int
$chashWithSalt :: Int -> TextDocumentSyncOptions -> Int
Hashable)
  deriving forall ann. [TextDocumentSyncOptions] -> Doc ann
forall ann. TextDocumentSyncOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TextDocumentSyncOptions] -> Doc ann
$cprettyList :: forall ann. [TextDocumentSyncOptions] -> Doc ann
pretty :: forall ann. TextDocumentSyncOptions -> Doc ann
$cpretty :: forall ann. TextDocumentSyncOptions -> Doc ann
Pretty via (ViaJSON TextDocumentSyncOptions)

instance Aeson.ToJSON TextDocumentSyncOptions where
  toJSON :: TextDocumentSyncOptions -> Value
toJSON (TextDocumentSyncOptions Maybe Bool
arg0 Maybe TextDocumentSyncKind
arg1 Maybe Bool
arg2 Maybe Bool
arg3 Maybe (Bool |? SaveOptions)
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
"openClose" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"change" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe TextDocumentSyncKind
arg1
    ,String
"willSave" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg2
    ,String
"willSaveWaitUntil" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg3
    ,String
"save" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Bool |? SaveOptions)
arg4]

instance Aeson.FromJSON TextDocumentSyncOptions where
  parseJSON :: Value -> Parser TextDocumentSyncOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentSyncOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe TextDocumentSyncKind
-> Maybe Bool
-> Maybe Bool
-> Maybe (Bool |? SaveOptions)
-> TextDocumentSyncOptions
TextDocumentSyncOptions 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
"openClose" 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
"change" 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
"willSave" 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
"willSaveWaitUntil" 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
"save"