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