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