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