{- 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.SemanticTokens 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.Types.Common

{-|
@since 3.16.0
-}
data SemanticTokens = SemanticTokens 
  { {-|
  An optional result id. If provided and clients support delta updating
  the client will include the result id in the next semantic token request.
  A server can then instead of computing all semantic tokens again simply
  send a delta.
  -}
  SemanticTokens -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The actual tokens.
  -}
  SemanticTokens -> [UInt]
_data_ :: [Language.LSP.Protocol.Types.Common.UInt]
  }
  deriving stock (Int -> SemanticTokens -> ShowS
[SemanticTokens] -> ShowS
SemanticTokens -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SemanticTokens] -> ShowS
$cshowList :: [SemanticTokens] -> ShowS
show :: SemanticTokens -> String
$cshow :: SemanticTokens -> String
showsPrec :: Int -> SemanticTokens -> ShowS
$cshowsPrec :: Int -> SemanticTokens -> ShowS
Show, SemanticTokens -> SemanticTokens -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemanticTokens -> SemanticTokens -> Bool
$c/= :: SemanticTokens -> SemanticTokens -> Bool
== :: SemanticTokens -> SemanticTokens -> Bool
$c== :: SemanticTokens -> SemanticTokens -> Bool
Eq, Eq SemanticTokens
SemanticTokens -> SemanticTokens -> Bool
SemanticTokens -> SemanticTokens -> Ordering
SemanticTokens -> SemanticTokens -> SemanticTokens
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 :: SemanticTokens -> SemanticTokens -> SemanticTokens
$cmin :: SemanticTokens -> SemanticTokens -> SemanticTokens
max :: SemanticTokens -> SemanticTokens -> SemanticTokens
$cmax :: SemanticTokens -> SemanticTokens -> SemanticTokens
>= :: SemanticTokens -> SemanticTokens -> Bool
$c>= :: SemanticTokens -> SemanticTokens -> Bool
> :: SemanticTokens -> SemanticTokens -> Bool
$c> :: SemanticTokens -> SemanticTokens -> Bool
<= :: SemanticTokens -> SemanticTokens -> Bool
$c<= :: SemanticTokens -> SemanticTokens -> Bool
< :: SemanticTokens -> SemanticTokens -> Bool
$c< :: SemanticTokens -> SemanticTokens -> Bool
compare :: SemanticTokens -> SemanticTokens -> Ordering
$ccompare :: SemanticTokens -> SemanticTokens -> Ordering
Ord, forall x. Rep SemanticTokens x -> SemanticTokens
forall x. SemanticTokens -> Rep SemanticTokens x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SemanticTokens x -> SemanticTokens
$cfrom :: forall x. SemanticTokens -> Rep SemanticTokens x
Generic)
  deriving anyclass (SemanticTokens -> ()
forall a. (a -> ()) -> NFData a
rnf :: SemanticTokens -> ()
$crnf :: SemanticTokens -> ()
NFData, Eq SemanticTokens
Int -> SemanticTokens -> Int
SemanticTokens -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SemanticTokens -> Int
$chash :: SemanticTokens -> Int
hashWithSalt :: Int -> SemanticTokens -> Int
$chashWithSalt :: Int -> SemanticTokens -> Int
Hashable)
  deriving forall ann. [SemanticTokens] -> Doc ann
forall ann. SemanticTokens -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SemanticTokens] -> Doc ann
$cprettyList :: forall ann. [SemanticTokens] -> Doc ann
pretty :: forall ann. SemanticTokens -> Doc ann
$cpretty :: forall ann. SemanticTokens -> Doc ann
Pretty via (ViaJSON SemanticTokens)

instance Aeson.ToJSON SemanticTokens where
  toJSON :: SemanticTokens -> Value
toJSON (SemanticTokens Maybe Text
arg0 [UInt]
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
"data" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [UInt]
arg1]]

instance Aeson.FromJSON SemanticTokens where
  parseJSON :: Value -> Parser SemanticTokens
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokens" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> [UInt] -> SemanticTokens
SemanticTokens 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
"data"