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

{-|
Code Lens provider options of a `CodeLensRequest`.
-}
data CodeLensOptions = CodeLensOptions 
  { {-|

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

instance Aeson.ToJSON CodeLensOptions where
  toJSON :: CodeLensOptions -> Value
toJSON (CodeLensOptions Maybe Bool
arg0 Maybe Bool
arg1) = [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
"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
arg1]

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