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