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

{-|
Parameters for a `SignatureHelpRequest`.
-}
data SignatureHelpParams = SignatureHelpParams 
  { {-|
  The text document.
  -}
  SignatureHelpParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The position inside the text document.
  -}
  SignatureHelpParams -> Position
_position :: Language.LSP.Protocol.Internal.Types.Position.Position
  , {-|
  An optional token that a server can use to report work done progress.
  -}
  SignatureHelpParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The signature help context. This is only available if the client specifies
  to send this using the client capability `textDocument.signatureHelp.contextSupport === true`

  @since 3.15.0
  -}
  SignatureHelpParams -> Maybe SignatureHelpContext
_context :: (Maybe Language.LSP.Protocol.Internal.Types.SignatureHelpContext.SignatureHelpContext)
  }
  deriving stock (Int -> SignatureHelpParams -> ShowS
[SignatureHelpParams] -> ShowS
SignatureHelpParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignatureHelpParams] -> ShowS
$cshowList :: [SignatureHelpParams] -> ShowS
show :: SignatureHelpParams -> String
$cshow :: SignatureHelpParams -> String
showsPrec :: Int -> SignatureHelpParams -> ShowS
$cshowsPrec :: Int -> SignatureHelpParams -> ShowS
Show, SignatureHelpParams -> SignatureHelpParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c/= :: SignatureHelpParams -> SignatureHelpParams -> Bool
== :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c== :: SignatureHelpParams -> SignatureHelpParams -> Bool
Eq, Eq SignatureHelpParams
SignatureHelpParams -> SignatureHelpParams -> Bool
SignatureHelpParams -> SignatureHelpParams -> Ordering
SignatureHelpParams -> SignatureHelpParams -> SignatureHelpParams
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 :: SignatureHelpParams -> SignatureHelpParams -> SignatureHelpParams
$cmin :: SignatureHelpParams -> SignatureHelpParams -> SignatureHelpParams
max :: SignatureHelpParams -> SignatureHelpParams -> SignatureHelpParams
$cmax :: SignatureHelpParams -> SignatureHelpParams -> SignatureHelpParams
>= :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c>= :: SignatureHelpParams -> SignatureHelpParams -> Bool
> :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c> :: SignatureHelpParams -> SignatureHelpParams -> Bool
<= :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c<= :: SignatureHelpParams -> SignatureHelpParams -> Bool
< :: SignatureHelpParams -> SignatureHelpParams -> Bool
$c< :: SignatureHelpParams -> SignatureHelpParams -> Bool
compare :: SignatureHelpParams -> SignatureHelpParams -> Ordering
$ccompare :: SignatureHelpParams -> SignatureHelpParams -> Ordering
Ord, forall x. Rep SignatureHelpParams x -> SignatureHelpParams
forall x. SignatureHelpParams -> Rep SignatureHelpParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignatureHelpParams x -> SignatureHelpParams
$cfrom :: forall x. SignatureHelpParams -> Rep SignatureHelpParams x
Generic)
  deriving anyclass (SignatureHelpParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: SignatureHelpParams -> ()
$crnf :: SignatureHelpParams -> ()
NFData, Eq SignatureHelpParams
Int -> SignatureHelpParams -> Int
SignatureHelpParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SignatureHelpParams -> Int
$chash :: SignatureHelpParams -> Int
hashWithSalt :: Int -> SignatureHelpParams -> Int
$chashWithSalt :: Int -> SignatureHelpParams -> Int
Hashable)
  deriving forall ann. [SignatureHelpParams] -> Doc ann
forall ann. SignatureHelpParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [SignatureHelpParams] -> Doc ann
$cprettyList :: forall ann. [SignatureHelpParams] -> Doc ann
pretty :: forall ann. SignatureHelpParams -> Doc ann
$cpretty :: forall ann. SignatureHelpParams -> Doc ann
Pretty via (ViaJSON SignatureHelpParams)

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

instance Aeson.FromJSON SignatureHelpParams where
  parseJSON :: Value -> Parser SignatureHelpParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SignatureHelpParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> TextDocumentIdentifier
-> Position
-> Maybe ProgressToken
-> Maybe SignatureHelpContext
-> SignatureHelpParams
SignatureHelpParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" 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
"position" 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
"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
"context"