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