{- 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.CodeActionOptions 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.Types.Common

{-|
Provider options for a `CodeActionRequest`.
-}
data CodeActionOptions = CodeActionOptions 
  { {-|

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

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

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