{- 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.WorkspaceEditClientCapabilities 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 as Row
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.FailureHandlingKind
import qualified Language.LSP.Protocol.Internal.Types.ResourceOperationKind
import qualified Language.LSP.Protocol.Types.Common

{-|

-}
data WorkspaceEditClientCapabilities = WorkspaceEditClientCapabilities 
  { {-|
  The client supports versioned document changes in `WorkspaceEdit`s
  -}
  WorkspaceEditClientCapabilities -> Maybe Bool
_documentChanges :: (Maybe Bool)
  , {-|
  The resource operations the client supports. Clients should at least
  support 'create', 'rename' and 'delete' files and folders.

  @since 3.13.0
  -}
  WorkspaceEditClientCapabilities -> Maybe [ResourceOperationKind]
_resourceOperations :: (Maybe [Language.LSP.Protocol.Internal.Types.ResourceOperationKind.ResourceOperationKind])
  , {-|
  The failure handling strategy of a client if applying the workspace edit
  fails.

  @since 3.13.0
  -}
  WorkspaceEditClientCapabilities -> Maybe FailureHandlingKind
_failureHandling :: (Maybe Language.LSP.Protocol.Internal.Types.FailureHandlingKind.FailureHandlingKind)
  , {-|
  Whether the client normalizes line endings to the client specific
  setting.
  If set to `true` the client will normalize line ending characters
  in a workspace edit to the client-specified new line
  character.

  @since 3.16.0
  -}
  WorkspaceEditClientCapabilities -> Maybe Bool
_normalizesLineEndings :: (Maybe Bool)
  , {-|
  Whether the client in general supports change annotations on text edits,
  create file, rename file and delete file changes.

  @since 3.16.0
  -}
  WorkspaceEditClientCapabilities
-> Maybe
     (Rec (Extend "groupsOnLabel" (Maybe Bool) ('R '[]) .+ 'R '[]))
_changeAnnotationSupport :: (Maybe (Row.Rec ("groupsOnLabel" Row..== (Maybe Bool) Row..+ Row.Empty)))
  }
  deriving stock (Int -> WorkspaceEditClientCapabilities -> ShowS
[WorkspaceEditClientCapabilities] -> ShowS
WorkspaceEditClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceEditClientCapabilities] -> ShowS
$cshowList :: [WorkspaceEditClientCapabilities] -> ShowS
show :: WorkspaceEditClientCapabilities -> String
$cshow :: WorkspaceEditClientCapabilities -> String
showsPrec :: Int -> WorkspaceEditClientCapabilities -> ShowS
$cshowsPrec :: Int -> WorkspaceEditClientCapabilities -> ShowS
Show, WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c/= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
== :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c== :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
Eq, Eq WorkspaceEditClientCapabilities
WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Ordering
WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
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 :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
$cmin :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
max :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
$cmax :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities
>= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c>= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
> :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c> :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
<= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c<= :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
< :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
$c< :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Bool
compare :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Ordering
$ccompare :: WorkspaceEditClientCapabilities
-> WorkspaceEditClientCapabilities -> Ordering
Ord, forall x.
Rep WorkspaceEditClientCapabilities x
-> WorkspaceEditClientCapabilities
forall x.
WorkspaceEditClientCapabilities
-> Rep WorkspaceEditClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceEditClientCapabilities x
-> WorkspaceEditClientCapabilities
$cfrom :: forall x.
WorkspaceEditClientCapabilities
-> Rep WorkspaceEditClientCapabilities x
Generic)
  deriving anyclass (WorkspaceEditClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceEditClientCapabilities -> ()
$crnf :: WorkspaceEditClientCapabilities -> ()
NFData, Eq WorkspaceEditClientCapabilities
Int -> WorkspaceEditClientCapabilities -> Int
WorkspaceEditClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceEditClientCapabilities -> Int
$chash :: WorkspaceEditClientCapabilities -> Int
hashWithSalt :: Int -> WorkspaceEditClientCapabilities -> Int
$chashWithSalt :: Int -> WorkspaceEditClientCapabilities -> Int
Hashable)
  deriving forall ann. [WorkspaceEditClientCapabilities] -> Doc ann
forall ann. WorkspaceEditClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceEditClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [WorkspaceEditClientCapabilities] -> Doc ann
pretty :: forall ann. WorkspaceEditClientCapabilities -> Doc ann
$cpretty :: forall ann. WorkspaceEditClientCapabilities -> Doc ann
Pretty via (ViaJSON WorkspaceEditClientCapabilities)

instance Aeson.ToJSON WorkspaceEditClientCapabilities where
  toJSON :: WorkspaceEditClientCapabilities -> Value
toJSON (WorkspaceEditClientCapabilities Maybe Bool
arg0 Maybe [ResourceOperationKind]
arg1 Maybe FailureHandlingKind
arg2 Maybe Bool
arg3 Maybe
  (Rec (Extend "groupsOnLabel" (Maybe Bool) ('R '[]) .+ 'R '[]))
arg4) = [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
"documentChanges" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"resourceOperations" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [ResourceOperationKind]
arg1
    ,String
"failureHandling" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe FailureHandlingKind
arg2
    ,String
"normalizesLineEndings" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg3
    ,String
"changeAnnotationSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec (Extend "groupsOnLabel" (Maybe Bool) ('R '[]) .+ 'R '[]))
arg4]

instance Aeson.FromJSON WorkspaceEditClientCapabilities where
  parseJSON :: Value -> Parser WorkspaceEditClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceEditClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> Maybe [ResourceOperationKind]
-> Maybe FailureHandlingKind
-> Maybe Bool
-> Maybe
     (Rec (Extend "groupsOnLabel" (Maybe Bool) ('R '[]) .+ 'R '[]))
-> WorkspaceEditClientCapabilities
WorkspaceEditClientCapabilities 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
"documentChanges" 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
"resourceOperations" 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
"failureHandling" 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
"normalizesLineEndings" 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
"changeAnnotationSupport"