{- 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.DocumentFormattingOptions 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.Types.Common

{-|
Provider options for a `DocumentFormattingRequest`.
-}
data DocumentFormattingOptions = DocumentFormattingOptions 
  { {-|

  -}
  DocumentFormattingOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  }
  deriving stock (Int -> DocumentFormattingOptions -> ShowS
[DocumentFormattingOptions] -> ShowS
DocumentFormattingOptions -> String
(Int -> DocumentFormattingOptions -> ShowS)
-> (DocumentFormattingOptions -> String)
-> ([DocumentFormattingOptions] -> ShowS)
-> Show DocumentFormattingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocumentFormattingOptions -> ShowS
showsPrec :: Int -> DocumentFormattingOptions -> ShowS
$cshow :: DocumentFormattingOptions -> String
show :: DocumentFormattingOptions -> String
$cshowList :: [DocumentFormattingOptions] -> ShowS
showList :: [DocumentFormattingOptions] -> ShowS
Show, DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
(DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> (DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> Eq DocumentFormattingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
== :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
$c/= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
/= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
Eq, Eq DocumentFormattingOptions
Eq DocumentFormattingOptions =>
(DocumentFormattingOptions
 -> DocumentFormattingOptions -> Ordering)
-> (DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> (DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> (DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> (DocumentFormattingOptions -> DocumentFormattingOptions -> Bool)
-> (DocumentFormattingOptions
    -> DocumentFormattingOptions -> DocumentFormattingOptions)
-> (DocumentFormattingOptions
    -> DocumentFormattingOptions -> DocumentFormattingOptions)
-> Ord DocumentFormattingOptions
DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
DocumentFormattingOptions -> DocumentFormattingOptions -> Ordering
DocumentFormattingOptions
-> DocumentFormattingOptions -> DocumentFormattingOptions
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 :: DocumentFormattingOptions -> DocumentFormattingOptions -> Ordering
compare :: DocumentFormattingOptions -> DocumentFormattingOptions -> Ordering
$c< :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
< :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
$c<= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
<= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
$c> :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
> :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
$c>= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
>= :: DocumentFormattingOptions -> DocumentFormattingOptions -> Bool
$cmax :: DocumentFormattingOptions
-> DocumentFormattingOptions -> DocumentFormattingOptions
max :: DocumentFormattingOptions
-> DocumentFormattingOptions -> DocumentFormattingOptions
$cmin :: DocumentFormattingOptions
-> DocumentFormattingOptions -> DocumentFormattingOptions
min :: DocumentFormattingOptions
-> DocumentFormattingOptions -> DocumentFormattingOptions
Ord, (forall x.
 DocumentFormattingOptions -> Rep DocumentFormattingOptions x)
-> (forall x.
    Rep DocumentFormattingOptions x -> DocumentFormattingOptions)
-> Generic DocumentFormattingOptions
forall x.
Rep DocumentFormattingOptions x -> DocumentFormattingOptions
forall x.
DocumentFormattingOptions -> Rep DocumentFormattingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DocumentFormattingOptions -> Rep DocumentFormattingOptions x
from :: forall x.
DocumentFormattingOptions -> Rep DocumentFormattingOptions x
$cto :: forall x.
Rep DocumentFormattingOptions x -> DocumentFormattingOptions
to :: forall x.
Rep DocumentFormattingOptions x -> DocumentFormattingOptions
Generic)
  deriving anyclass (DocumentFormattingOptions -> ()
(DocumentFormattingOptions -> ())
-> NFData DocumentFormattingOptions
forall a. (a -> ()) -> NFData a
$crnf :: DocumentFormattingOptions -> ()
rnf :: DocumentFormattingOptions -> ()
NFData, Eq DocumentFormattingOptions
Eq DocumentFormattingOptions =>
(Int -> DocumentFormattingOptions -> Int)
-> (DocumentFormattingOptions -> Int)
-> Hashable DocumentFormattingOptions
Int -> DocumentFormattingOptions -> Int
DocumentFormattingOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DocumentFormattingOptions -> Int
hashWithSalt :: Int -> DocumentFormattingOptions -> Int
$chash :: DocumentFormattingOptions -> Int
hash :: DocumentFormattingOptions -> Int
Hashable)
  deriving (forall ann. DocumentFormattingOptions -> Doc ann)
-> (forall ann. [DocumentFormattingOptions] -> Doc ann)
-> Pretty DocumentFormattingOptions
forall ann. [DocumentFormattingOptions] -> Doc ann
forall ann. DocumentFormattingOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DocumentFormattingOptions -> Doc ann
pretty :: forall ann. DocumentFormattingOptions -> Doc ann
$cprettyList :: forall ann. [DocumentFormattingOptions] -> Doc ann
prettyList :: forall ann. [DocumentFormattingOptions] -> Doc ann
Pretty via (ViaJSON DocumentFormattingOptions)

instance Aeson.ToJSON DocumentFormattingOptions where
  toJSON :: DocumentFormattingOptions -> Value
toJSON (DocumentFormattingOptions Maybe Bool
arg0) = [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
$  [String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0]

instance Aeson.FromJSON DocumentFormattingOptions where
  parseJSON :: Value -> Parser DocumentFormattingOptions
parseJSON = String
-> (Object -> Parser DocumentFormattingOptions)
-> Value
-> Parser DocumentFormattingOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentFormattingOptions" ((Object -> Parser DocumentFormattingOptions)
 -> Value -> Parser DocumentFormattingOptions)
-> (Object -> Parser DocumentFormattingOptions)
-> Value
-> Parser DocumentFormattingOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> DocumentFormattingOptions
DocumentFormattingOptions (Maybe Bool -> DocumentFormattingOptions)
-> Parser (Maybe Bool) -> Parser DocumentFormattingOptions
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress"