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