{- 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.SemanticTokensDelta 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 Data.Text
import qualified Language.LSP.Protocol.Internal.Types.SemanticTokensEdit
import qualified Language.LSP.Protocol.Types.Common

{-|
@since 3.16.0
-}
data SemanticTokensDelta = SemanticTokensDelta 
  { {-|

  -}
  SemanticTokensDelta -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The semantic token edits to transform a previous result into a new result.
  -}
  SemanticTokensDelta -> [SemanticTokensEdit]
_edits :: [Language.LSP.Protocol.Internal.Types.SemanticTokensEdit.SemanticTokensEdit]
  }
  deriving stock (Int -> SemanticTokensDelta -> ShowS
[SemanticTokensDelta] -> ShowS
SemanticTokensDelta -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SemanticTokensDelta] -> ShowS
$cshowList :: [SemanticTokensDelta] -> ShowS
show :: SemanticTokensDelta -> String
$cshow :: SemanticTokensDelta -> String
showsPrec :: Int -> SemanticTokensDelta -> ShowS
$cshowsPrec :: Int -> SemanticTokensDelta -> ShowS
Show, SemanticTokensDelta -> SemanticTokensDelta -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c/= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
== :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c== :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
Eq, Eq SemanticTokensDelta
SemanticTokensDelta -> SemanticTokensDelta -> Bool
SemanticTokensDelta -> SemanticTokensDelta -> Ordering
SemanticTokensDelta -> SemanticTokensDelta -> SemanticTokensDelta
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 :: SemanticTokensDelta -> SemanticTokensDelta -> SemanticTokensDelta
$cmin :: SemanticTokensDelta -> SemanticTokensDelta -> SemanticTokensDelta
max :: SemanticTokensDelta -> SemanticTokensDelta -> SemanticTokensDelta
$cmax :: SemanticTokensDelta -> SemanticTokensDelta -> SemanticTokensDelta
>= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c>= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
> :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c> :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
<= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c<= :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
< :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
$c< :: SemanticTokensDelta -> SemanticTokensDelta -> Bool
compare :: SemanticTokensDelta -> SemanticTokensDelta -> Ordering
$ccompare :: SemanticTokensDelta -> SemanticTokensDelta -> Ordering
Ord, forall x. Rep SemanticTokensDelta x -> SemanticTokensDelta
forall x. SemanticTokensDelta -> Rep SemanticTokensDelta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SemanticTokensDelta x -> SemanticTokensDelta
$cfrom :: forall x. SemanticTokensDelta -> Rep SemanticTokensDelta x
Generic)
  deriving anyclass (SemanticTokensDelta -> ()
forall a. (a -> ()) -> NFData a
rnf :: SemanticTokensDelta -> ()
$crnf :: SemanticTokensDelta -> ()
NFData, Eq SemanticTokensDelta
Int -> SemanticTokensDelta -> Int
SemanticTokensDelta -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SemanticTokensDelta -> Int
$chash :: SemanticTokensDelta -> Int
hashWithSalt :: Int -> SemanticTokensDelta -> Int
$chashWithSalt :: Int -> SemanticTokensDelta -> Int
Hashable)
  deriving forall ann. [SemanticTokensDelta] -> Doc ann
forall ann. SemanticTokensDelta -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SemanticTokensDelta] -> Doc ann
$cprettyList :: forall ann. [SemanticTokensDelta] -> Doc ann
pretty :: forall ann. SemanticTokensDelta -> Doc ann
$cpretty :: forall ann. SemanticTokensDelta -> Doc ann
Pretty via (ViaJSON SemanticTokensDelta)

instance Aeson.ToJSON SemanticTokensDelta where
  toJSON :: SemanticTokensDelta -> Value
toJSON (SemanticTokensDelta Maybe Text
arg0 [SemanticTokensEdit]
arg1) = [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
$  [String
"resultId" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg0
    ,[Key
"edits" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [SemanticTokensEdit]
arg1]]

instance Aeson.FromJSON SemanticTokensDelta where
  parseJSON :: Value -> Parser SemanticTokensDelta
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokensDelta" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> [SemanticTokensEdit] -> SemanticTokensDelta
SemanticTokensDelta forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"resultId" 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
"edits"