{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.WillSaveTextDocumentParams 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.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentSaveReason
import qualified Language.LSP.Protocol.Types.Common
data WillSaveTextDocumentParams = WillSaveTextDocumentParams
{
WillSaveTextDocumentParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
,
WillSaveTextDocumentParams -> TextDocumentSaveReason
_reason :: Language.LSP.Protocol.Internal.Types.TextDocumentSaveReason.TextDocumentSaveReason
}
deriving stock (Int -> WillSaveTextDocumentParams -> ShowS
[WillSaveTextDocumentParams] -> ShowS
WillSaveTextDocumentParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WillSaveTextDocumentParams] -> ShowS
$cshowList :: [WillSaveTextDocumentParams] -> ShowS
show :: WillSaveTextDocumentParams -> String
$cshow :: WillSaveTextDocumentParams -> String
showsPrec :: Int -> WillSaveTextDocumentParams -> ShowS
$cshowsPrec :: Int -> WillSaveTextDocumentParams -> ShowS
Show, WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c/= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
== :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c== :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
Eq, Eq WillSaveTextDocumentParams
WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> Ordering
WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> WillSaveTextDocumentParams
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 :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> WillSaveTextDocumentParams
$cmin :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> WillSaveTextDocumentParams
max :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> WillSaveTextDocumentParams
$cmax :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> WillSaveTextDocumentParams
>= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c>= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
> :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c> :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
<= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c<= :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
< :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
$c< :: WillSaveTextDocumentParams -> WillSaveTextDocumentParams -> Bool
compare :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> Ordering
$ccompare :: WillSaveTextDocumentParams
-> WillSaveTextDocumentParams -> Ordering
Ord, forall x.
Rep WillSaveTextDocumentParams x -> WillSaveTextDocumentParams
forall x.
WillSaveTextDocumentParams -> Rep WillSaveTextDocumentParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WillSaveTextDocumentParams x -> WillSaveTextDocumentParams
$cfrom :: forall x.
WillSaveTextDocumentParams -> Rep WillSaveTextDocumentParams x
Generic)
deriving anyclass (WillSaveTextDocumentParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: WillSaveTextDocumentParams -> ()
$crnf :: WillSaveTextDocumentParams -> ()
NFData, Eq WillSaveTextDocumentParams
Int -> WillSaveTextDocumentParams -> Int
WillSaveTextDocumentParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WillSaveTextDocumentParams -> Int
$chash :: WillSaveTextDocumentParams -> Int
hashWithSalt :: Int -> WillSaveTextDocumentParams -> Int
$chashWithSalt :: Int -> WillSaveTextDocumentParams -> Int
Hashable)
deriving forall ann. [WillSaveTextDocumentParams] -> Doc ann
forall ann. WillSaveTextDocumentParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WillSaveTextDocumentParams] -> Doc ann
$cprettyList :: forall ann. [WillSaveTextDocumentParams] -> Doc ann
pretty :: forall ann. WillSaveTextDocumentParams -> Doc ann
$cpretty :: forall ann. WillSaveTextDocumentParams -> Doc ann
Pretty via (ViaJSON WillSaveTextDocumentParams)
instance Aeson.ToJSON WillSaveTextDocumentParams where
toJSON :: WillSaveTextDocumentParams -> Value
toJSON (WillSaveTextDocumentParams TextDocumentIdentifier
arg0 TextDocumentSaveReason
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
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg0]
,[Key
"reason" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentSaveReason
arg1]]
instance Aeson.FromJSON WillSaveTextDocumentParams where
parseJSON :: Value -> Parser WillSaveTextDocumentParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WillSaveTextDocumentParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> TextDocumentIdentifier
-> TextDocumentSaveReason -> WillSaveTextDocumentParams
WillSaveTextDocumentParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"reason"