{- 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.SignatureHelpOptions 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

{-|
Server Capabilities for a `SignatureHelpRequest`.
-}
data SignatureHelpOptions = SignatureHelpOptions 
  { {-|

  -}
  SignatureHelpOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  List of characters that trigger signature help automatically.
  -}
  SignatureHelpOptions -> Maybe [Text]
_triggerCharacters :: (Maybe [Data.Text.Text])
  , {-|
  List of characters that re-trigger signature help.

  These trigger characters are only active when signature help is already showing. All trigger characters
  are also counted as re-trigger characters.

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

instance Aeson.ToJSON SignatureHelpOptions where
  toJSON :: SignatureHelpOptions -> Value
toJSON (SignatureHelpOptions Maybe Bool
arg0 Maybe [Text]
arg1 Maybe [Text]
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
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"triggerCharacters" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [Text]
arg1
    ,String
"retriggerCharacters" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [Text]
arg2]

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