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