{- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentOnTypeFormattingOptions] -> ShowS
$cshowList :: [DocumentOnTypeFormattingOptions] -> ShowS
show :: DocumentOnTypeFormattingOptions -> String
$cshow :: DocumentOnTypeFormattingOptions -> String
showsPrec :: Int -> DocumentOnTypeFormattingOptions -> ShowS
$cshowsPrec :: Int -> DocumentOnTypeFormattingOptions -> ShowS
Show, DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c/= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
== :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$c== :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
Eq, Eq 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
min :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
$cmin :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
max :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
$cmax :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions
>= :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Bool
$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
compare :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Ordering
$ccompare :: DocumentOnTypeFormattingOptions
-> DocumentOnTypeFormattingOptions -> Ordering
Ord, 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
$cto :: forall x.
Rep DocumentOnTypeFormattingOptions x
-> DocumentOnTypeFormattingOptions
$cfrom :: forall x.
DocumentOnTypeFormattingOptions
-> Rep DocumentOnTypeFormattingOptions x
Generic)
  deriving anyclass (DocumentOnTypeFormattingOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentOnTypeFormattingOptions -> ()
$crnf :: DocumentOnTypeFormattingOptions -> ()
NFData, Eq DocumentOnTypeFormattingOptions
Int -> DocumentOnTypeFormattingOptions -> Int
DocumentOnTypeFormattingOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentOnTypeFormattingOptions -> Int
$chash :: DocumentOnTypeFormattingOptions -> Int
hashWithSalt :: Int -> DocumentOnTypeFormattingOptions -> Int
$chashWithSalt :: Int -> DocumentOnTypeFormattingOptions -> Int
Hashable)
  deriving forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
forall ann. DocumentOnTypeFormattingOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
$cprettyList :: forall ann. [DocumentOnTypeFormattingOptions] -> Doc ann
pretty :: forall ann. DocumentOnTypeFormattingOptions -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"firstTriggerCharacter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,String
"moreTriggerCharacter" forall kv v. (KeyValue 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 = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentOnTypeFormattingOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> Maybe [Text] -> DocumentOnTypeFormattingOptions
DocumentOnTypeFormattingOptions forall (f :: * -> *) a b. Functor 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"