{- 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.DocumentOnTypeFormattingOptions 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

{-|
Provider options for a `DocumentOnTypeFormattingRequest`.
-}
data DocumentOnTypeFormattingOptions = DocumentOnTypeFormattingOptions 
  { {-|
  A character on which formatting should be triggered, like `{`.
  -}
  DocumentOnTypeFormattingOptions -> Text
_firstTriggerCharacter :: Data.Text.Text
  , {-|
  More trigger characters.
  -}
  DocumentOnTypeFormattingOptions -> Maybe [Text]
_moreTriggerCharacter :: (Maybe [Data.Text.Text])
  }
  deriving stock (Int -> DocumentOnTypeFormattingOptions -> ShowS
[DocumentOnTypeFormattingOptions] -> ShowS
DocumentOnTypeFormattingOptions -> String
(Int -> DocumentOnTypeFormattingOptions -> ShowS)
-> (DocumentOnTypeFormattingOptions -> String)
-> ([DocumentOnTypeFormattingOptions] -> ShowS)
-> Show DocumentOnTypeFormattingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocumentOnTypeFormattingOptions -> ShowS
showsPrec :: Int -> DocumentOnTypeFormattingOptions -> ShowS
$cshow :: DocumentOnTypeFormattingOptions -> String
show :: DocumentOnTypeFormattingOptions -> String
$cshowList :: [DocumentOnTypeFormattingOptions] -> ShowS
showList :: [DocumentOnTypeFormattingOptions] -> ShowS
Show, DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
(DocumentOnTypeFormattingOptions
 -> DocumentOnTypeFormattingOptions -> Bool)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions -> Bool)
-> Eq DocumentOnTypeFormattingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
== :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c/= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
/= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
Eq, Eq DocumentOnTypeFormattingOptions
Eq DocumentOnTypeFormattingOptions =>
(DocumentOnTypeFormattingOptions
 -> DocumentOnTypeFormattingOptions -> Ordering)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions -> Bool)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions -> Bool)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions -> Bool)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions -> Bool)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions)
-> (DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions
    -> DocumentOnTypeFormattingOptions)
-> Ord DocumentOnTypeFormattingOptions
DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Ordering
DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
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 :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Ordering
compare :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Ordering
$c< :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
< :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c<= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
<= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c> :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
> :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c>= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
>= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$cmax :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
max :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
$cmin :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
min :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
Ord, (forall x.
 DocumentOnTypeFormattingOptions
 -> Rep DocumentOnTypeFormattingOptions x)
-> (forall x.
    Rep DocumentOnTypeFormattingOptions x
    -> DocumentOnTypeFormattingOptions)
-> Generic DocumentOnTypeFormattingOptions
forall x.
Rep DocumentOnTypeFormattingOptions x
-> DocumentOnTypeFormattingOptions
forall x.
DocumentOnTypeFormattingOptions
-> Rep DocumentOnTypeFormattingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DocumentOnTypeFormattingOptions
-> Rep DocumentOnTypeFormattingOptions x
from :: forall x.
DocumentOnTypeFormattingOptions
-> Rep DocumentOnTypeFormattingOptions x
$cto :: forall x.
Rep DocumentOnTypeFormattingOptions x
-> DocumentOnTypeFormattingOptions
to :: forall x.
Rep DocumentOnTypeFormattingOptions x
-> DocumentOnTypeFormattingOptions
Generic)
  deriving anyclass (DocumentOnTypeFormattingOptions -> ()
(DocumentOnTypeFormattingOptions -> ())
-> NFData DocumentOnTypeFormattingOptions
forall a. (a -> ()) -> NFData a
$crnf :: DocumentOnTypeFormattingOptions -> ()
rnf :: DocumentOnTypeFormattingOptions -> ()
NFData, Eq DocumentOnTypeFormattingOptions
Eq DocumentOnTypeFormattingOptions =>
(Int -> DocumentOnTypeFormattingOptions -> Int)
-> (DocumentOnTypeFormattingOptions -> Int)
-> Hashable DocumentOnTypeFormattingOptions
Int -> DocumentOnTypeFormattingOptions -> Int
DocumentOnTypeFormattingOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DocumentOnTypeFormattingOptions -> Int
hashWithSalt :: Int -> DocumentOnTypeFormattingOptions -> Int
$chash :: DocumentOnTypeFormattingOptions -> Int
hash :: DocumentOnTypeFormattingOptions -> Int
Hashable)
  deriving (forall ann. DocumentOnTypeFormattingOptions -> Doc ann)
-> (forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann)
-> Pretty DocumentOnTypeFormattingOptions
forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
forall ann. DocumentOnTypeFormattingOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DocumentOnTypeFormattingOptions -> Doc ann
pretty :: forall ann. DocumentOnTypeFormattingOptions -> Doc ann
$cprettyList :: forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
prettyList :: forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
Pretty via (ViaJSON DocumentOnTypeFormattingOptions)

instance Aeson.ToJSON DocumentOnTypeFormattingOptions where
  toJSON :: DocumentOnTypeFormattingOptions -> Value
toJSON (DocumentOnTypeFormattingOptions Text
arg0 Maybe [Text]
arg1) = [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
$  [[Key
"firstTriggerCharacter" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,String
"moreTriggerCharacter" 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]

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