{- 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.ClientCapabilities where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson
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.GeneralClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.NotebookDocumentClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.WindowClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.WorkspaceClientCapabilities
import qualified Language.LSP.Protocol.Types.Common

{-|
Defines the capabilities provided by the client.
-}
data ClientCapabilities = ClientCapabilities 
  { {-|
  Workspace specific client capabilities.
  -}
  ClientCapabilities -> Maybe WorkspaceClientCapabilities
_workspace :: (Maybe Language.LSP.Protocol.Internal.Types.WorkspaceClientCapabilities.WorkspaceClientCapabilities)
  , {-|
  Text document specific client capabilities.
  -}
  ClientCapabilities -> Maybe TextDocumentClientCapabilities
_textDocument :: (Maybe Language.LSP.Protocol.Internal.Types.TextDocumentClientCapabilities.TextDocumentClientCapabilities)
  , {-|
  Capabilities specific to the notebook document support.

  @since 3.17.0
  -}
  ClientCapabilities -> Maybe NotebookDocumentClientCapabilities
_notebookDocument :: (Maybe Language.LSP.Protocol.Internal.Types.NotebookDocumentClientCapabilities.NotebookDocumentClientCapabilities)
  , {-|
  Window specific client capabilities.
  -}
  ClientCapabilities -> Maybe WindowClientCapabilities
_window :: (Maybe Language.LSP.Protocol.Internal.Types.WindowClientCapabilities.WindowClientCapabilities)
  , {-|
  General client capabilities.

  @since 3.16.0
  -}
  ClientCapabilities -> Maybe GeneralClientCapabilities
_general :: (Maybe Language.LSP.Protocol.Internal.Types.GeneralClientCapabilities.GeneralClientCapabilities)
  , {-|
  Experimental client capabilities.
  -}
  ClientCapabilities -> Maybe Value
_experimental :: (Maybe Data.Aeson.Value)
  }
  deriving stock (Int -> ClientCapabilities -> ShowS
[ClientCapabilities] -> ShowS
ClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientCapabilities] -> ShowS
$cshowList :: [ClientCapabilities] -> ShowS
show :: ClientCapabilities -> String
$cshow :: ClientCapabilities -> String
showsPrec :: Int -> ClientCapabilities -> ShowS
$cshowsPrec :: Int -> ClientCapabilities -> ShowS
Show, ClientCapabilities -> ClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientCapabilities -> ClientCapabilities -> Bool
$c/= :: ClientCapabilities -> ClientCapabilities -> Bool
== :: ClientCapabilities -> ClientCapabilities -> Bool
$c== :: ClientCapabilities -> ClientCapabilities -> Bool
Eq, Eq ClientCapabilities
ClientCapabilities -> ClientCapabilities -> Bool
ClientCapabilities -> ClientCapabilities -> Ordering
ClientCapabilities -> ClientCapabilities -> ClientCapabilities
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
min :: ClientCapabilities -> ClientCapabilities -> ClientCapabilities
$cmin :: ClientCapabilities -> ClientCapabilities -> ClientCapabilities
max :: ClientCapabilities -> ClientCapabilities -> ClientCapabilities
$cmax :: ClientCapabilities -> ClientCapabilities -> ClientCapabilities
>= :: ClientCapabilities -> ClientCapabilities -> Bool
$c>= :: ClientCapabilities -> ClientCapabilities -> Bool
> :: ClientCapabilities -> ClientCapabilities -> Bool
$c> :: ClientCapabilities -> ClientCapabilities -> Bool
<= :: ClientCapabilities -> ClientCapabilities -> Bool
$c<= :: ClientCapabilities -> ClientCapabilities -> Bool
< :: ClientCapabilities -> ClientCapabilities -> Bool
$c< :: ClientCapabilities -> ClientCapabilities -> Bool
compare :: ClientCapabilities -> ClientCapabilities -> Ordering
$ccompare :: ClientCapabilities -> ClientCapabilities -> Ordering
Ord, forall x. Rep ClientCapabilities x -> ClientCapabilities
forall x. ClientCapabilities -> Rep ClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientCapabilities x -> ClientCapabilities
$cfrom :: forall x. ClientCapabilities -> Rep ClientCapabilities x
Generic)
  deriving anyclass (ClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: ClientCapabilities -> ()
$crnf :: ClientCapabilities -> ()
NFData, Eq ClientCapabilities
Int -> ClientCapabilities -> Int
ClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ClientCapabilities -> Int
$chash :: ClientCapabilities -> Int
hashWithSalt :: Int -> ClientCapabilities -> Int
$chashWithSalt :: Int -> ClientCapabilities -> Int
Hashable)
  deriving forall ann. [ClientCapabilities] -> Doc ann
forall ann. ClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [ClientCapabilities] -> Doc ann
pretty :: forall ann. ClientCapabilities -> Doc ann
$cpretty :: forall ann. ClientCapabilities -> Doc ann
Pretty via (ViaJSON ClientCapabilities)

instance Aeson.ToJSON ClientCapabilities where
  toJSON :: ClientCapabilities -> Value
toJSON (ClientCapabilities Maybe WorkspaceClientCapabilities
arg0 Maybe TextDocumentClientCapabilities
arg1 Maybe NotebookDocumentClientCapabilities
arg2 Maybe WindowClientCapabilities
arg3 Maybe GeneralClientCapabilities
arg4 Maybe Value
arg5) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [String
"workspace" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe WorkspaceClientCapabilities
arg0
    ,String
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe TextDocumentClientCapabilities
arg1
    ,String
"notebookDocument" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe NotebookDocumentClientCapabilities
arg2
    ,String
"window" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe WindowClientCapabilities
arg3
    ,String
"general" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe GeneralClientCapabilities
arg4
    ,String
"experimental" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Value
arg5]

instance Aeson.FromJSON ClientCapabilities where
  parseJSON :: Value -> Parser ClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe WorkspaceClientCapabilities
-> Maybe TextDocumentClientCapabilities
-> Maybe NotebookDocumentClientCapabilities
-> Maybe WindowClientCapabilities
-> Maybe GeneralClientCapabilities
-> Maybe Value
-> ClientCapabilities
ClientCapabilities forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"workspace" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"textDocument" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"notebookDocument" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"window" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"general" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"experimental"