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