{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# 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

{-|
@since 3.16.0
-}
data SemanticTokensEdit = SemanticTokensEdit 
  { {-|
  The start offset of the edit.
  -}
  SemanticTokensEdit -> UInt
_start :: Language.LSP.Protocol.Types.Common.UInt
  , {-|
  The count of elements to remove.
  -}
  SemanticTokensEdit -> UInt
_deleteCount :: Language.LSP.Protocol.Types.Common.UInt
  , {-|
  The elements to insert.
  -}
  SemanticTokensEdit -> Maybe [UInt]
_data_ :: (Maybe [Language.LSP.Protocol.Types.Common.UInt])
  }
  deriving stock (Int -> SemanticTokensEdit -> ShowS
[SemanticTokensEdit] -> ShowS
SemanticTokensEdit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SemanticTokensEdit] -> ShowS
$cshowList :: [SemanticTokensEdit] -> ShowS
show :: SemanticTokensEdit -> String
$cshow :: SemanticTokensEdit -> String
showsPrec :: Int -> SemanticTokensEdit -> ShowS
$cshowsPrec :: Int -> SemanticTokensEdit -> ShowS
Show, SemanticTokensEdit -> SemanticTokensEdit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemanticTokensEdit -> SemanticTokensEdit -> Bool
$c/= :: SemanticTokensEdit -> SemanticTokensEdit -> Bool
== :: SemanticTokensEdit -> SemanticTokensEdit -> Bool
$c== :: SemanticTokensEdit -> SemanticTokensEdit -> Bool
Eq, Eq 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
min :: SemanticTokensEdit -> SemanticTokensEdit -> SemanticTokensEdit
$cmin :: SemanticTokensEdit -> SemanticTokensEdit -> SemanticTokensEdit
max :: SemanticTokensEdit -> SemanticTokensEdit -> SemanticTokensEdit
$cmax :: SemanticTokensEdit -> SemanticTokensEdit -> SemanticTokensEdit
>= :: SemanticTokensEdit -> SemanticTokensEdit -> Bool
$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
compare :: SemanticTokensEdit -> SemanticTokensEdit -> Ordering
$ccompare :: SemanticTokensEdit -> SemanticTokensEdit -> Ordering
Ord, 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
$cto :: forall x. Rep SemanticTokensEdit x -> SemanticTokensEdit
$cfrom :: forall x. SemanticTokensEdit -> Rep SemanticTokensEdit x
Generic)
  deriving anyclass (SemanticTokensEdit -> ()
forall a. (a -> ()) -> NFData a
rnf :: SemanticTokensEdit -> ()
$crnf :: SemanticTokensEdit -> ()
NFData, Eq SemanticTokensEdit
Int -> SemanticTokensEdit -> Int
SemanticTokensEdit -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SemanticTokensEdit -> Int
$chash :: SemanticTokensEdit -> Int
hashWithSalt :: Int -> SemanticTokensEdit -> Int
$chashWithSalt :: Int -> SemanticTokensEdit -> Int
Hashable)
  deriving forall ann. [SemanticTokensEdit] -> Doc ann
forall ann. SemanticTokensEdit -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SemanticTokensEdit] -> Doc ann
$cprettyList :: forall ann. [SemanticTokensEdit] -> Doc ann
pretty :: forall ann. SemanticTokensEdit -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"start" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= UInt
arg0]
    ,[Key
"deleteCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= UInt
arg1]
    ,String
"data" forall kv v. (KeyValue 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 = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokensEdit" forall a b. (a -> b) -> a -> b
$ \Object
arg -> UInt -> UInt -> Maybe [UInt] -> SemanticTokensEdit
SemanticTokensEdit forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"start" 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
"deleteCount" 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
"data"