{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.DeclarationOptions 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
data DeclarationOptions = DeclarationOptions
{
DeclarationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
}
deriving stock (Int -> DeclarationOptions -> ShowS
[DeclarationOptions] -> ShowS
DeclarationOptions -> String
(Int -> DeclarationOptions -> ShowS)
-> (DeclarationOptions -> String)
-> ([DeclarationOptions] -> ShowS)
-> Show DeclarationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeclarationOptions -> ShowS
showsPrec :: Int -> DeclarationOptions -> ShowS
$cshow :: DeclarationOptions -> String
show :: DeclarationOptions -> String
$cshowList :: [DeclarationOptions] -> ShowS
showList :: [DeclarationOptions] -> ShowS
Show, DeclarationOptions -> DeclarationOptions -> Bool
(DeclarationOptions -> DeclarationOptions -> Bool)
-> (DeclarationOptions -> DeclarationOptions -> Bool)
-> Eq DeclarationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeclarationOptions -> DeclarationOptions -> Bool
== :: DeclarationOptions -> DeclarationOptions -> Bool
$c/= :: DeclarationOptions -> DeclarationOptions -> Bool
/= :: DeclarationOptions -> DeclarationOptions -> Bool
Eq, Eq DeclarationOptions
Eq DeclarationOptions =>
(DeclarationOptions -> DeclarationOptions -> Ordering)
-> (DeclarationOptions -> DeclarationOptions -> Bool)
-> (DeclarationOptions -> DeclarationOptions -> Bool)
-> (DeclarationOptions -> DeclarationOptions -> Bool)
-> (DeclarationOptions -> DeclarationOptions -> Bool)
-> (DeclarationOptions -> DeclarationOptions -> DeclarationOptions)
-> (DeclarationOptions -> DeclarationOptions -> DeclarationOptions)
-> Ord DeclarationOptions
DeclarationOptions -> DeclarationOptions -> Bool
DeclarationOptions -> DeclarationOptions -> Ordering
DeclarationOptions -> DeclarationOptions -> DeclarationOptions
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 :: DeclarationOptions -> DeclarationOptions -> Ordering
compare :: DeclarationOptions -> DeclarationOptions -> Ordering
$c< :: DeclarationOptions -> DeclarationOptions -> Bool
< :: DeclarationOptions -> DeclarationOptions -> Bool
$c<= :: DeclarationOptions -> DeclarationOptions -> Bool
<= :: DeclarationOptions -> DeclarationOptions -> Bool
$c> :: DeclarationOptions -> DeclarationOptions -> Bool
> :: DeclarationOptions -> DeclarationOptions -> Bool
$c>= :: DeclarationOptions -> DeclarationOptions -> Bool
>= :: DeclarationOptions -> DeclarationOptions -> Bool
$cmax :: DeclarationOptions -> DeclarationOptions -> DeclarationOptions
max :: DeclarationOptions -> DeclarationOptions -> DeclarationOptions
$cmin :: DeclarationOptions -> DeclarationOptions -> DeclarationOptions
min :: DeclarationOptions -> DeclarationOptions -> DeclarationOptions
Ord, (forall x. DeclarationOptions -> Rep DeclarationOptions x)
-> (forall x. Rep DeclarationOptions x -> DeclarationOptions)
-> Generic DeclarationOptions
forall x. Rep DeclarationOptions x -> DeclarationOptions
forall x. DeclarationOptions -> Rep DeclarationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DeclarationOptions -> Rep DeclarationOptions x
from :: forall x. DeclarationOptions -> Rep DeclarationOptions x
$cto :: forall x. Rep DeclarationOptions x -> DeclarationOptions
to :: forall x. Rep DeclarationOptions x -> DeclarationOptions
Generic)
deriving anyclass (DeclarationOptions -> ()
(DeclarationOptions -> ()) -> NFData DeclarationOptions
forall a. (a -> ()) -> NFData a
$crnf :: DeclarationOptions -> ()
rnf :: DeclarationOptions -> ()
NFData, Eq DeclarationOptions
Eq DeclarationOptions =>
(Int -> DeclarationOptions -> Int)
-> (DeclarationOptions -> Int) -> Hashable DeclarationOptions
Int -> DeclarationOptions -> Int
DeclarationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DeclarationOptions -> Int
hashWithSalt :: Int -> DeclarationOptions -> Int
$chash :: DeclarationOptions -> Int
hash :: DeclarationOptions -> Int
Hashable)
deriving (forall ann. DeclarationOptions -> Doc ann)
-> (forall ann. [DeclarationOptions] -> Doc ann)
-> Pretty DeclarationOptions
forall ann. [DeclarationOptions] -> Doc ann
forall ann. DeclarationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DeclarationOptions -> Doc ann
pretty :: forall ann. DeclarationOptions -> Doc ann
$cprettyList :: forall ann. [DeclarationOptions] -> Doc ann
prettyList :: forall ann. [DeclarationOptions] -> Doc ann
Pretty via (ViaJSON DeclarationOptions)
instance Aeson.ToJSON DeclarationOptions where
toJSON :: DeclarationOptions -> Value
toJSON (DeclarationOptions Maybe Bool
arg0) = [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]
instance Aeson.FromJSON DeclarationOptions where
parseJSON :: Value -> Parser DeclarationOptions
parseJSON = String
-> (Object -> Parser DeclarationOptions)
-> Value
-> Parser DeclarationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DeclarationOptions" ((Object -> Parser DeclarationOptions)
-> Value -> Parser DeclarationOptions)
-> (Object -> Parser DeclarationOptions)
-> Value
-> Parser DeclarationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> DeclarationOptions
DeclarationOptions (Maybe Bool -> DeclarationOptions)
-> Parser (Maybe Bool) -> Parser DeclarationOptions
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"