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

{-|

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

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

instance Aeson.FromJSON TypeDefinitionParams where
  parseJSON :: Value -> Parser TypeDefinitionParams
parseJSON = String
-> (Object -> Parser TypeDefinitionParams)
-> Value
-> Parser TypeDefinitionParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TypeDefinitionParams" ((Object -> Parser TypeDefinitionParams)
 -> Value -> Parser TypeDefinitionParams)
-> (Object -> Parser TypeDefinitionParams)
-> Value
-> Parser TypeDefinitionParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> TextDocumentIdentifier
-> Position
-> Maybe ProgressToken
-> Maybe ProgressToken
-> TypeDefinitionParams
TypeDefinitionParams (TextDocumentIdentifier
 -> Position
 -> Maybe ProgressToken
 -> Maybe ProgressToken
 -> TypeDefinitionParams)
-> Parser TextDocumentIdentifier
-> Parser
     (Position
      -> Maybe ProgressToken
      -> Maybe ProgressToken
      -> TypeDefinitionParams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser TextDocumentIdentifier
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" Parser
  (Position
   -> Maybe ProgressToken
   -> Maybe ProgressToken
   -> TypeDefinitionParams)
-> Parser Position
-> Parser
     (Maybe ProgressToken
      -> Maybe ProgressToken -> TypeDefinitionParams)
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 Position
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"position" Parser
  (Maybe ProgressToken
   -> Maybe ProgressToken -> TypeDefinitionParams)
-> Parser (Maybe ProgressToken)
-> Parser (Maybe ProgressToken -> TypeDefinitionParams)
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 ProgressToken)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneToken" Parser (Maybe ProgressToken -> TypeDefinitionParams)
-> Parser (Maybe ProgressToken) -> Parser TypeDefinitionParams
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 ProgressToken)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"partialResultToken"