{- 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.SelectionRangeClientCapabilities 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 SelectionRangeClientCapabilities = SelectionRangeClientCapabilities 
  { {-|
  Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
  the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
  capability as well.
  -}
  SelectionRangeClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  }
  deriving stock (Int -> SelectionRangeClientCapabilities -> ShowS
[SelectionRangeClientCapabilities] -> ShowS
SelectionRangeClientCapabilities -> String
(Int -> SelectionRangeClientCapabilities -> ShowS)
-> (SelectionRangeClientCapabilities -> String)
-> ([SelectionRangeClientCapabilities] -> ShowS)
-> Show SelectionRangeClientCapabilities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SelectionRangeClientCapabilities -> ShowS
showsPrec :: Int -> SelectionRangeClientCapabilities -> ShowS
$cshow :: SelectionRangeClientCapabilities -> String
show :: SelectionRangeClientCapabilities -> String
$cshowList :: [SelectionRangeClientCapabilities] -> ShowS
showList :: [SelectionRangeClientCapabilities] -> ShowS
Show, SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
(SelectionRangeClientCapabilities
 -> SelectionRangeClientCapabilities -> Bool)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities -> Bool)
-> Eq SelectionRangeClientCapabilities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
== :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
$c/= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
/= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
Eq, Eq SelectionRangeClientCapabilities
Eq SelectionRangeClientCapabilities =>
(SelectionRangeClientCapabilities
 -> SelectionRangeClientCapabilities -> Ordering)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities -> Bool)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities -> Bool)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities -> Bool)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities -> Bool)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities)
-> (SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities
    -> SelectionRangeClientCapabilities)
-> Ord SelectionRangeClientCapabilities
SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Ordering
SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
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 :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Ordering
compare :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Ordering
$c< :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
< :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
$c<= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
<= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
$c> :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
> :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
$c>= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
>= :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities -> Bool
$cmax :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
max :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
$cmin :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
min :: SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
-> SelectionRangeClientCapabilities
Ord, (forall x.
 SelectionRangeClientCapabilities
 -> Rep SelectionRangeClientCapabilities x)
-> (forall x.
    Rep SelectionRangeClientCapabilities x
    -> SelectionRangeClientCapabilities)
-> Generic SelectionRangeClientCapabilities
forall x.
Rep SelectionRangeClientCapabilities x
-> SelectionRangeClientCapabilities
forall x.
SelectionRangeClientCapabilities
-> Rep SelectionRangeClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SelectionRangeClientCapabilities
-> Rep SelectionRangeClientCapabilities x
from :: forall x.
SelectionRangeClientCapabilities
-> Rep SelectionRangeClientCapabilities x
$cto :: forall x.
Rep SelectionRangeClientCapabilities x
-> SelectionRangeClientCapabilities
to :: forall x.
Rep SelectionRangeClientCapabilities x
-> SelectionRangeClientCapabilities
Generic)
  deriving anyclass (SelectionRangeClientCapabilities -> ()
(SelectionRangeClientCapabilities -> ())
-> NFData SelectionRangeClientCapabilities
forall a. (a -> ()) -> NFData a
$crnf :: SelectionRangeClientCapabilities -> ()
rnf :: SelectionRangeClientCapabilities -> ()
NFData, Eq SelectionRangeClientCapabilities
Eq SelectionRangeClientCapabilities =>
(Int -> SelectionRangeClientCapabilities -> Int)
-> (SelectionRangeClientCapabilities -> Int)
-> Hashable SelectionRangeClientCapabilities
Int -> SelectionRangeClientCapabilities -> Int
SelectionRangeClientCapabilities -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> SelectionRangeClientCapabilities -> Int
hashWithSalt :: Int -> SelectionRangeClientCapabilities -> Int
$chash :: SelectionRangeClientCapabilities -> Int
hash :: SelectionRangeClientCapabilities -> Int
Hashable)
  deriving (forall ann. SelectionRangeClientCapabilities -> Doc ann)
-> (forall ann. [SelectionRangeClientCapabilities] -> Doc ann)
-> Pretty SelectionRangeClientCapabilities
forall ann. [SelectionRangeClientCapabilities] -> Doc ann
forall ann. SelectionRangeClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. SelectionRangeClientCapabilities -> Doc ann
pretty :: forall ann. SelectionRangeClientCapabilities -> Doc ann
$cprettyList :: forall ann. [SelectionRangeClientCapabilities] -> Doc ann
prettyList :: forall ann. [SelectionRangeClientCapabilities] -> Doc ann
Pretty via (ViaJSON SelectionRangeClientCapabilities)

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