{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.DocumentRangeFormattingOptions 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
data DocumentRangeFormattingOptions = DocumentRangeFormattingOptions
{
DocumentRangeFormattingOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
}
deriving stock (Int -> DocumentRangeFormattingOptions -> ShowS
[DocumentRangeFormattingOptions] -> ShowS
DocumentRangeFormattingOptions -> String
(Int -> DocumentRangeFormattingOptions -> ShowS)
-> (DocumentRangeFormattingOptions -> String)
-> ([DocumentRangeFormattingOptions] -> ShowS)
-> Show DocumentRangeFormattingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocumentRangeFormattingOptions -> ShowS
showsPrec :: Int -> DocumentRangeFormattingOptions -> ShowS
$cshow :: DocumentRangeFormattingOptions -> String
show :: DocumentRangeFormattingOptions -> String
$cshowList :: [DocumentRangeFormattingOptions] -> ShowS
showList :: [DocumentRangeFormattingOptions] -> ShowS
Show, DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
(DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> Eq DocumentRangeFormattingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
== :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
$c/= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
/= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
Eq, Eq DocumentRangeFormattingOptions
Eq DocumentRangeFormattingOptions =>
(DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Ordering)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions)
-> (DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions)
-> Ord DocumentRangeFormattingOptions
DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Ordering
DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> DocumentRangeFormattingOptions
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 :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Ordering
compare :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Ordering
$c< :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
< :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
$c<= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
<= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
$c> :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
> :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
$c>= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
>= :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> Bool
$cmax :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> DocumentRangeFormattingOptions
max :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> DocumentRangeFormattingOptions
$cmin :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> DocumentRangeFormattingOptions
min :: DocumentRangeFormattingOptions
-> DocumentRangeFormattingOptions -> DocumentRangeFormattingOptions
Ord, (forall x.
DocumentRangeFormattingOptions
-> Rep DocumentRangeFormattingOptions x)
-> (forall x.
Rep DocumentRangeFormattingOptions x
-> DocumentRangeFormattingOptions)
-> Generic DocumentRangeFormattingOptions
forall x.
Rep DocumentRangeFormattingOptions x
-> DocumentRangeFormattingOptions
forall x.
DocumentRangeFormattingOptions
-> Rep DocumentRangeFormattingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DocumentRangeFormattingOptions
-> Rep DocumentRangeFormattingOptions x
from :: forall x.
DocumentRangeFormattingOptions
-> Rep DocumentRangeFormattingOptions x
$cto :: forall x.
Rep DocumentRangeFormattingOptions x
-> DocumentRangeFormattingOptions
to :: forall x.
Rep DocumentRangeFormattingOptions x
-> DocumentRangeFormattingOptions
Generic)
deriving anyclass (DocumentRangeFormattingOptions -> ()
(DocumentRangeFormattingOptions -> ())
-> NFData DocumentRangeFormattingOptions
forall a. (a -> ()) -> NFData a
$crnf :: DocumentRangeFormattingOptions -> ()
rnf :: DocumentRangeFormattingOptions -> ()
NFData, Eq DocumentRangeFormattingOptions
Eq DocumentRangeFormattingOptions =>
(Int -> DocumentRangeFormattingOptions -> Int)
-> (DocumentRangeFormattingOptions -> Int)
-> Hashable DocumentRangeFormattingOptions
Int -> DocumentRangeFormattingOptions -> Int
DocumentRangeFormattingOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DocumentRangeFormattingOptions -> Int
hashWithSalt :: Int -> DocumentRangeFormattingOptions -> Int
$chash :: DocumentRangeFormattingOptions -> Int
hash :: DocumentRangeFormattingOptions -> Int
Hashable)
deriving (forall ann. DocumentRangeFormattingOptions -> Doc ann)
-> (forall ann. [DocumentRangeFormattingOptions] -> Doc ann)
-> Pretty DocumentRangeFormattingOptions
forall ann. [DocumentRangeFormattingOptions] -> Doc ann
forall ann. DocumentRangeFormattingOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DocumentRangeFormattingOptions -> Doc ann
pretty :: forall ann. DocumentRangeFormattingOptions -> Doc ann
$cprettyList :: forall ann. [DocumentRangeFormattingOptions] -> Doc ann
prettyList :: forall ann. [DocumentRangeFormattingOptions] -> Doc ann
Pretty via (ViaJSON DocumentRangeFormattingOptions)
instance Aeson.ToJSON DocumentRangeFormattingOptions where
toJSON :: DocumentRangeFormattingOptions -> Value
toJSON (DocumentRangeFormattingOptions 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 DocumentRangeFormattingOptions where
parseJSON :: Value -> Parser DocumentRangeFormattingOptions
parseJSON = String
-> (Object -> Parser DocumentRangeFormattingOptions)
-> Value
-> Parser DocumentRangeFormattingOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentRangeFormattingOptions" ((Object -> Parser DocumentRangeFormattingOptions)
-> Value -> Parser DocumentRangeFormattingOptions)
-> (Object -> Parser DocumentRangeFormattingOptions)
-> Value
-> Parser DocumentRangeFormattingOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> DocumentRangeFormattingOptions
DocumentRangeFormattingOptions (Maybe Bool -> DocumentRangeFormattingOptions)
-> Parser (Maybe Bool) -> Parser DocumentRangeFormattingOptions
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"