{- 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
(Int -> CodeActionOptions -> ShowS)
-> (CodeActionOptions -> String)
-> ([CodeActionOptions] -> ShowS)
-> Show CodeActionOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionOptions -> ShowS
showsPrec :: Int -> CodeActionOptions -> ShowS
$cshow :: CodeActionOptions -> String
show :: CodeActionOptions -> String
$cshowList :: [CodeActionOptions] -> ShowS
showList :: [CodeActionOptions] -> ShowS
Show, CodeActionOptions -> CodeActionOptions -> Bool
(CodeActionOptions -> CodeActionOptions -> Bool)
-> (CodeActionOptions -> CodeActionOptions -> Bool)
-> Eq CodeActionOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionOptions -> CodeActionOptions -> Bool
== :: CodeActionOptions -> CodeActionOptions -> Bool
$c/= :: CodeActionOptions -> CodeActionOptions -> Bool
/= :: CodeActionOptions -> CodeActionOptions -> Bool
Eq, Eq CodeActionOptions
Eq CodeActionOptions =>
(CodeActionOptions -> CodeActionOptions -> Ordering)
-> (CodeActionOptions -> CodeActionOptions -> Bool)
-> (CodeActionOptions -> CodeActionOptions -> Bool)
-> (CodeActionOptions -> CodeActionOptions -> Bool)
-> (CodeActionOptions -> CodeActionOptions -> Bool)
-> (CodeActionOptions -> CodeActionOptions -> CodeActionOptions)
-> (CodeActionOptions -> CodeActionOptions -> CodeActionOptions)
-> Ord 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
$ccompare :: CodeActionOptions -> CodeActionOptions -> Ordering
compare :: CodeActionOptions -> CodeActionOptions -> Ordering
$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
>= :: CodeActionOptions -> CodeActionOptions -> Bool
$cmax :: CodeActionOptions -> CodeActionOptions -> CodeActionOptions
max :: CodeActionOptions -> CodeActionOptions -> CodeActionOptions
$cmin :: CodeActionOptions -> CodeActionOptions -> CodeActionOptions
min :: CodeActionOptions -> CodeActionOptions -> CodeActionOptions
Ord, (forall x. CodeActionOptions -> Rep CodeActionOptions x)
-> (forall x. Rep CodeActionOptions x -> CodeActionOptions)
-> Generic CodeActionOptions
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
$cfrom :: forall x. CodeActionOptions -> Rep CodeActionOptions x
from :: forall x. CodeActionOptions -> Rep CodeActionOptions x
$cto :: forall x. Rep CodeActionOptions x -> CodeActionOptions
to :: forall x. Rep CodeActionOptions x -> CodeActionOptions
Generic)
  deriving anyclass (CodeActionOptions -> ()
(CodeActionOptions -> ()) -> NFData CodeActionOptions
forall a. (a -> ()) -> NFData a
$crnf :: CodeActionOptions -> ()
rnf :: CodeActionOptions -> ()
NFData, Eq CodeActionOptions
Eq CodeActionOptions =>
(Int -> CodeActionOptions -> Int)
-> (CodeActionOptions -> Int) -> Hashable CodeActionOptions
Int -> CodeActionOptions -> Int
CodeActionOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> CodeActionOptions -> Int
hashWithSalt :: Int -> CodeActionOptions -> Int
$chash :: CodeActionOptions -> Int
hash :: CodeActionOptions -> Int
Hashable)
  deriving (forall ann. CodeActionOptions -> Doc ann)
-> (forall ann. [CodeActionOptions] -> Doc ann)
-> Pretty CodeActionOptions
forall ann. [CodeActionOptions] -> Doc ann
forall ann. CodeActionOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. CodeActionOptions -> Doc ann
pretty :: forall ann. CodeActionOptions -> Doc ann
$cprettyList :: forall ann. [CodeActionOptions] -> Doc ann
prettyList :: 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 ([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
$  [String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"codeActionKinds" String -> Maybe [CodeActionKind] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [CodeActionKind]
arg1
    ,String
"resolveProvider" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e 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 = String
-> (Object -> Parser CodeActionOptions)
-> Value
-> Parser CodeActionOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CodeActionOptions" ((Object -> Parser CodeActionOptions)
 -> Value -> Parser CodeActionOptions)
-> (Object -> Parser CodeActionOptions)
-> Value
-> Parser CodeActionOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe [CodeActionKind] -> Maybe Bool -> CodeActionOptions
CodeActionOptions (Maybe Bool
 -> Maybe [CodeActionKind] -> Maybe Bool -> CodeActionOptions)
-> Parser (Maybe Bool)
-> Parser
     (Maybe [CodeActionKind] -> Maybe Bool -> CodeActionOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser (Maybe [CodeActionKind] -> Maybe Bool -> CodeActionOptions)
-> Parser (Maybe [CodeActionKind])
-> Parser (Maybe Bool -> CodeActionOptions)
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 [CodeActionKind])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"codeActionKinds" Parser (Maybe Bool -> CodeActionOptions)
-> Parser (Maybe Bool) -> Parser CodeActionOptions
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 Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"resolveProvider"