{- 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.DocumentOnTypeFormattingRegistrationOptions 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.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Registration options for a `DocumentOnTypeFormattingRequest`.
-}
data DocumentOnTypeFormattingRegistrationOptions = DocumentOnTypeFormattingRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  DocumentOnTypeFormattingRegistrationOptions
-> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|
  A character on which formatting should be triggered, like `{`.
  -}
  DocumentOnTypeFormattingRegistrationOptions -> Text
_firstTriggerCharacter :: Data.Text.Text
  , {-|
  More trigger characters.
  -}
  DocumentOnTypeFormattingRegistrationOptions -> Maybe [Text]
_moreTriggerCharacter :: (Maybe [Data.Text.Text])
  }
  deriving stock (Int -> DocumentOnTypeFormattingRegistrationOptions -> ShowS
[DocumentOnTypeFormattingRegistrationOptions] -> ShowS
DocumentOnTypeFormattingRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentOnTypeFormattingRegistrationOptions] -> ShowS
$cshowList :: [DocumentOnTypeFormattingRegistrationOptions] -> ShowS
show :: DocumentOnTypeFormattingRegistrationOptions -> String
$cshow :: DocumentOnTypeFormattingRegistrationOptions -> String
showsPrec :: Int -> DocumentOnTypeFormattingRegistrationOptions -> ShowS
$cshowsPrec :: Int -> DocumentOnTypeFormattingRegistrationOptions -> ShowS
Show, DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c/= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
== :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c== :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
Eq, Eq DocumentOnTypeFormattingRegistrationOptions
DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Ordering
DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
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 :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
$cmin :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
max :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
$cmax :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions
>= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c>= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
> :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c> :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
<= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c<= :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
< :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
$c< :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Bool
compare :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Ordering
$ccompare :: DocumentOnTypeFormattingRegistrationOptions
-> DocumentOnTypeFormattingRegistrationOptions -> Ordering
Ord, forall x.
Rep DocumentOnTypeFormattingRegistrationOptions x
-> DocumentOnTypeFormattingRegistrationOptions
forall x.
DocumentOnTypeFormattingRegistrationOptions
-> Rep DocumentOnTypeFormattingRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentOnTypeFormattingRegistrationOptions x
-> DocumentOnTypeFormattingRegistrationOptions
$cfrom :: forall x.
DocumentOnTypeFormattingRegistrationOptions
-> Rep DocumentOnTypeFormattingRegistrationOptions x
Generic)
  deriving anyclass (DocumentOnTypeFormattingRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentOnTypeFormattingRegistrationOptions -> ()
$crnf :: DocumentOnTypeFormattingRegistrationOptions -> ()
NFData, Eq DocumentOnTypeFormattingRegistrationOptions
Int -> DocumentOnTypeFormattingRegistrationOptions -> Int
DocumentOnTypeFormattingRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentOnTypeFormattingRegistrationOptions -> Int
$chash :: DocumentOnTypeFormattingRegistrationOptions -> Int
hashWithSalt :: Int -> DocumentOnTypeFormattingRegistrationOptions -> Int
$chashWithSalt :: Int -> DocumentOnTypeFormattingRegistrationOptions -> Int
Hashable)
  deriving forall ann.
[DocumentOnTypeFormattingRegistrationOptions] -> Doc ann
forall ann. DocumentOnTypeFormattingRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann.
[DocumentOnTypeFormattingRegistrationOptions] -> Doc ann
$cprettyList :: forall ann.
[DocumentOnTypeFormattingRegistrationOptions] -> Doc ann
pretty :: forall ann. DocumentOnTypeFormattingRegistrationOptions -> Doc ann
$cpretty :: forall ann. DocumentOnTypeFormattingRegistrationOptions -> Doc ann
Pretty via (ViaJSON DocumentOnTypeFormattingRegistrationOptions)

instance Aeson.ToJSON DocumentOnTypeFormattingRegistrationOptions where
  toJSON :: DocumentOnTypeFormattingRegistrationOptions -> Value
toJSON (DocumentOnTypeFormattingRegistrationOptions DocumentSelector |? Null
arg0 Text
arg1 Maybe [Text]
arg2) = [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
$  [[Key
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,[Key
"firstTriggerCharacter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]
    ,String
"moreTriggerCharacter" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [Text]
arg2]

instance Aeson.FromJSON DocumentOnTypeFormattingRegistrationOptions where
  parseJSON :: Value -> Parser DocumentOnTypeFormattingRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentOnTypeFormattingRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Text
-> Maybe [Text]
-> DocumentOnTypeFormattingRegistrationOptions
DocumentOnTypeFormattingRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" 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
"firstTriggerCharacter" 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
"moreTriggerCharacter"