{- 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.DocumentHighlightRegistrationOptions 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.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Registration options for a `DocumentHighlightRequest`.
-}
data DocumentHighlightRegistrationOptions = DocumentHighlightRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  DocumentHighlightRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

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

instance Aeson.ToJSON DocumentHighlightRegistrationOptions where
  toJSON :: DocumentHighlightRegistrationOptions -> Value
toJSON (DocumentHighlightRegistrationOptions DocumentSelector |? Null
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
$  [[Key
"documentSelector" Key -> (DocumentSelector |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,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
arg1]

instance Aeson.FromJSON DocumentHighlightRegistrationOptions where
  parseJSON :: Value -> Parser DocumentHighlightRegistrationOptions
parseJSON = String
-> (Object -> Parser DocumentHighlightRegistrationOptions)
-> Value
-> Parser DocumentHighlightRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentHighlightRegistrationOptions" ((Object -> Parser DocumentHighlightRegistrationOptions)
 -> Value -> Parser DocumentHighlightRegistrationOptions)
-> (Object -> Parser DocumentHighlightRegistrationOptions)
-> Value
-> Parser DocumentHighlightRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> DocumentHighlightRegistrationOptions
DocumentHighlightRegistrationOptions ((DocumentSelector |? Null)
 -> Maybe Bool -> DocumentHighlightRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser (Maybe Bool -> DocumentHighlightRegistrationOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (DocumentSelector |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" Parser (Maybe Bool -> DocumentHighlightRegistrationOptions)
-> Parser (Maybe Bool)
-> Parser DocumentHighlightRegistrationOptions
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
"workDoneProgress"