{- 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.DiagnosticWorkspaceClientCapabilities 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

{-|
Workspace client capabilities specific to diagnostic pull requests.

@since 3.17.0
-}
data DiagnosticWorkspaceClientCapabilities = DiagnosticWorkspaceClientCapabilities 
  { {-|
  Whether the client implementation supports a refresh request sent from
  the server to the client.

  Note that this event is global and will force the client to refresh all
  pulled diagnostics currently shown. It should be used with absolute care and
  is useful for situation where a server for example detects a project wide
  change that requires such a calculation.
  -}
  DiagnosticWorkspaceClientCapabilities -> Maybe Bool
_refreshSupport :: (Maybe Bool)
  }
  deriving stock (Int -> DiagnosticWorkspaceClientCapabilities -> ShowS
[DiagnosticWorkspaceClientCapabilities] -> ShowS
DiagnosticWorkspaceClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiagnosticWorkspaceClientCapabilities] -> ShowS
$cshowList :: [DiagnosticWorkspaceClientCapabilities] -> ShowS
show :: DiagnosticWorkspaceClientCapabilities -> String
$cshow :: DiagnosticWorkspaceClientCapabilities -> String
showsPrec :: Int -> DiagnosticWorkspaceClientCapabilities -> ShowS
$cshowsPrec :: Int -> DiagnosticWorkspaceClientCapabilities -> ShowS
Show, DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c/= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
== :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c== :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
Eq, Eq DiagnosticWorkspaceClientCapabilities
DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Ordering
DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
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 :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
$cmin :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
max :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
$cmax :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities
>= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c>= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
> :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c> :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
<= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c<= :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
< :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
$c< :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Bool
compare :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Ordering
$ccompare :: DiagnosticWorkspaceClientCapabilities
-> DiagnosticWorkspaceClientCapabilities -> Ordering
Ord, forall x.
Rep DiagnosticWorkspaceClientCapabilities x
-> DiagnosticWorkspaceClientCapabilities
forall x.
DiagnosticWorkspaceClientCapabilities
-> Rep DiagnosticWorkspaceClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DiagnosticWorkspaceClientCapabilities x
-> DiagnosticWorkspaceClientCapabilities
$cfrom :: forall x.
DiagnosticWorkspaceClientCapabilities
-> Rep DiagnosticWorkspaceClientCapabilities x
Generic)
  deriving anyclass (DiagnosticWorkspaceClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: DiagnosticWorkspaceClientCapabilities -> ()
$crnf :: DiagnosticWorkspaceClientCapabilities -> ()
NFData, Eq DiagnosticWorkspaceClientCapabilities
Int -> DiagnosticWorkspaceClientCapabilities -> Int
DiagnosticWorkspaceClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DiagnosticWorkspaceClientCapabilities -> Int
$chash :: DiagnosticWorkspaceClientCapabilities -> Int
hashWithSalt :: Int -> DiagnosticWorkspaceClientCapabilities -> Int
$chashWithSalt :: Int -> DiagnosticWorkspaceClientCapabilities -> Int
Hashable)
  deriving forall ann. [DiagnosticWorkspaceClientCapabilities] -> Doc ann
forall ann. DiagnosticWorkspaceClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DiagnosticWorkspaceClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [DiagnosticWorkspaceClientCapabilities] -> Doc ann
pretty :: forall ann. DiagnosticWorkspaceClientCapabilities -> Doc ann
$cpretty :: forall ann. DiagnosticWorkspaceClientCapabilities -> Doc ann
Pretty via (ViaJSON DiagnosticWorkspaceClientCapabilities)

instance Aeson.ToJSON DiagnosticWorkspaceClientCapabilities where
  toJSON :: DiagnosticWorkspaceClientCapabilities -> Value
toJSON (DiagnosticWorkspaceClientCapabilities Maybe Bool
arg0) = [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
"refreshSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0]

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