{- 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.SemanticTokensParams 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.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
@since 3.16.0
-}
data SemanticTokensParams = SemanticTokensParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  SemanticTokensParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  An optional token that a server can use to report partial results (e.g. streaming) to
  the client.
  -}
  SemanticTokensParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The text document.
  -}
  SemanticTokensParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  }
  deriving stock (Int -> SemanticTokensParams -> ShowS
[SemanticTokensParams] -> ShowS
SemanticTokensParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SemanticTokensParams] -> ShowS
$cshowList :: [SemanticTokensParams] -> ShowS
show :: SemanticTokensParams -> String
$cshow :: SemanticTokensParams -> String
showsPrec :: Int -> SemanticTokensParams -> ShowS
$cshowsPrec :: Int -> SemanticTokensParams -> ShowS
Show, SemanticTokensParams -> SemanticTokensParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c/= :: SemanticTokensParams -> SemanticTokensParams -> Bool
== :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c== :: SemanticTokensParams -> SemanticTokensParams -> Bool
Eq, Eq SemanticTokensParams
SemanticTokensParams -> SemanticTokensParams -> Bool
SemanticTokensParams -> SemanticTokensParams -> Ordering
SemanticTokensParams
-> SemanticTokensParams -> SemanticTokensParams
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 :: SemanticTokensParams
-> SemanticTokensParams -> SemanticTokensParams
$cmin :: SemanticTokensParams
-> SemanticTokensParams -> SemanticTokensParams
max :: SemanticTokensParams
-> SemanticTokensParams -> SemanticTokensParams
$cmax :: SemanticTokensParams
-> SemanticTokensParams -> SemanticTokensParams
>= :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c>= :: SemanticTokensParams -> SemanticTokensParams -> Bool
> :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c> :: SemanticTokensParams -> SemanticTokensParams -> Bool
<= :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c<= :: SemanticTokensParams -> SemanticTokensParams -> Bool
< :: SemanticTokensParams -> SemanticTokensParams -> Bool
$c< :: SemanticTokensParams -> SemanticTokensParams -> Bool
compare :: SemanticTokensParams -> SemanticTokensParams -> Ordering
$ccompare :: SemanticTokensParams -> SemanticTokensParams -> Ordering
Ord, forall x. Rep SemanticTokensParams x -> SemanticTokensParams
forall x. SemanticTokensParams -> Rep SemanticTokensParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SemanticTokensParams x -> SemanticTokensParams
$cfrom :: forall x. SemanticTokensParams -> Rep SemanticTokensParams x
Generic)
  deriving anyclass (SemanticTokensParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: SemanticTokensParams -> ()
$crnf :: SemanticTokensParams -> ()
NFData, Eq SemanticTokensParams
Int -> SemanticTokensParams -> Int
SemanticTokensParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SemanticTokensParams -> Int
$chash :: SemanticTokensParams -> Int
hashWithSalt :: Int -> SemanticTokensParams -> Int
$chashWithSalt :: Int -> SemanticTokensParams -> Int
Hashable)
  deriving forall ann. [SemanticTokensParams] -> Doc ann
forall ann. SemanticTokensParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SemanticTokensParams] -> Doc ann
$cprettyList :: forall ann. [SemanticTokensParams] -> Doc ann
pretty :: forall ann. SemanticTokensParams -> Doc ann
$cpretty :: forall ann. SemanticTokensParams -> Doc ann
Pretty via (ViaJSON SemanticTokensParams)

instance Aeson.ToJSON SemanticTokensParams where
  toJSON :: SemanticTokensParams -> Value
toJSON (SemanticTokensParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TextDocumentIdentifier
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
$  [String
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,String
"partialResultToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg1
    ,[Key
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg2]]

instance Aeson.FromJSON SemanticTokensParams where
  parseJSON :: Value -> Parser SemanticTokensParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SemanticTokensParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken
-> TextDocumentIdentifier
-> SemanticTokensParams
SemanticTokensParams 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
"workDoneToken" 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
"partialResultToken" 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
"textDocument"