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