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