{- 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.CodeActionRegistrationOptions 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.CodeActionKind
import qualified Language.LSP.Protocol.Internal.Types.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Registration options for a `CodeActionRequest`.
-}
data CodeActionRegistrationOptions = CodeActionRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  CodeActionRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  CodeActionRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  CodeActionKinds that this server may return.

  The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
  may list out every specific kind they provide.
  -}
  CodeActionRegistrationOptions -> Maybe [CodeActionKind]
_codeActionKinds :: (Maybe [Language.LSP.Protocol.Internal.Types.CodeActionKind.CodeActionKind])
  , {-|
  The server provides support to resolve additional
  information for a code action.

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

instance Aeson.ToJSON CodeActionRegistrationOptions where
  toJSON :: CodeActionRegistrationOptions -> Value
toJSON (CodeActionRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1 Maybe [CodeActionKind]
arg2 Maybe Bool
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
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"codeActionKinds" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [CodeActionKind]
arg2
    ,String
"resolveProvider" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg3]

instance Aeson.FromJSON CodeActionRegistrationOptions where
  parseJSON :: Value -> Parser CodeActionRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CodeActionRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool
-> Maybe [CodeActionKind]
-> Maybe Bool
-> CodeActionRegistrationOptions
CodeActionRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" 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
"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
"codeActionKinds" 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
"resolveProvider"