{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.GeneralClientCapabilities 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 Data.Text
import qualified Language.LSP.Protocol.Internal.Types.MarkdownClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.PositionEncodingKind
import qualified Language.LSP.Protocol.Internal.Types.RegularExpressionsClientCapabilities
import qualified Language.LSP.Protocol.Types.Common
data GeneralClientCapabilities = GeneralClientCapabilities
{
GeneralClientCapabilities
-> Maybe
(Rec
(("cancel" .== Bool)
.+ (Extend "retryOnContentModified" [Text] ('R '[]) .+ 'R '[])))
_staleRequestSupport :: (Maybe (Row.Rec ("cancel" Row..== Bool Row..+ ("retryOnContentModified" Row..== [Data.Text.Text] Row..+ Row.Empty))))
,
GeneralClientCapabilities
-> Maybe RegularExpressionsClientCapabilities
_regularExpressions :: (Maybe Language.LSP.Protocol.Internal.Types.RegularExpressionsClientCapabilities.RegularExpressionsClientCapabilities)
,
GeneralClientCapabilities -> Maybe MarkdownClientCapabilities
_markdown :: (Maybe Language.LSP.Protocol.Internal.Types.MarkdownClientCapabilities.MarkdownClientCapabilities)
,
GeneralClientCapabilities -> Maybe [PositionEncodingKind]
_positionEncodings :: (Maybe [Language.LSP.Protocol.Internal.Types.PositionEncodingKind.PositionEncodingKind])
}
deriving stock (Int -> GeneralClientCapabilities -> ShowS
[GeneralClientCapabilities] -> ShowS
GeneralClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeneralClientCapabilities] -> ShowS
$cshowList :: [GeneralClientCapabilities] -> ShowS
show :: GeneralClientCapabilities -> String
$cshow :: GeneralClientCapabilities -> String
showsPrec :: Int -> GeneralClientCapabilities -> ShowS
$cshowsPrec :: Int -> GeneralClientCapabilities -> ShowS
Show, GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c/= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
== :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c== :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
Eq, Eq GeneralClientCapabilities
GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
GeneralClientCapabilities -> GeneralClientCapabilities -> Ordering
GeneralClientCapabilities
-> GeneralClientCapabilities -> GeneralClientCapabilities
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 :: GeneralClientCapabilities
-> GeneralClientCapabilities -> GeneralClientCapabilities
$cmin :: GeneralClientCapabilities
-> GeneralClientCapabilities -> GeneralClientCapabilities
max :: GeneralClientCapabilities
-> GeneralClientCapabilities -> GeneralClientCapabilities
$cmax :: GeneralClientCapabilities
-> GeneralClientCapabilities -> GeneralClientCapabilities
>= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c>= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
> :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c> :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
<= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c<= :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
< :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
$c< :: GeneralClientCapabilities -> GeneralClientCapabilities -> Bool
compare :: GeneralClientCapabilities -> GeneralClientCapabilities -> Ordering
$ccompare :: GeneralClientCapabilities -> GeneralClientCapabilities -> Ordering
Ord, forall x.
Rep GeneralClientCapabilities x -> GeneralClientCapabilities
forall x.
GeneralClientCapabilities -> Rep GeneralClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GeneralClientCapabilities x -> GeneralClientCapabilities
$cfrom :: forall x.
GeneralClientCapabilities -> Rep GeneralClientCapabilities x
Generic)
deriving anyclass (GeneralClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: GeneralClientCapabilities -> ()
$crnf :: GeneralClientCapabilities -> ()
NFData, Eq GeneralClientCapabilities
Int -> GeneralClientCapabilities -> Int
GeneralClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: GeneralClientCapabilities -> Int
$chash :: GeneralClientCapabilities -> Int
hashWithSalt :: Int -> GeneralClientCapabilities -> Int
$chashWithSalt :: Int -> GeneralClientCapabilities -> Int
Hashable)
deriving forall ann. [GeneralClientCapabilities] -> Doc ann
forall ann. GeneralClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [GeneralClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [GeneralClientCapabilities] -> Doc ann
pretty :: forall ann. GeneralClientCapabilities -> Doc ann
$cpretty :: forall ann. GeneralClientCapabilities -> Doc ann
Pretty via (ViaJSON GeneralClientCapabilities)
instance Aeson.ToJSON GeneralClientCapabilities where
toJSON :: GeneralClientCapabilities -> Value
toJSON (GeneralClientCapabilities Maybe
(Rec
(("cancel" .== Bool)
.+ (Extend "retryOnContentModified" [Text] ('R '[]) .+ 'R '[])))
arg0 Maybe RegularExpressionsClientCapabilities
arg1 Maybe MarkdownClientCapabilities
arg2 Maybe [PositionEncodingKind]
arg3) = [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
"staleRequestSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
(Rec
(("cancel" .== Bool)
.+ (Extend "retryOnContentModified" [Text] ('R '[]) .+ 'R '[])))
arg0
,String
"regularExpressions" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe RegularExpressionsClientCapabilities
arg1
,String
"markdown" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe MarkdownClientCapabilities
arg2
,String
"positionEncodings" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [PositionEncodingKind]
arg3]
instance Aeson.FromJSON GeneralClientCapabilities where
parseJSON :: Value -> Parser GeneralClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"GeneralClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe
(Rec
(("cancel" .== Bool)
.+ (Extend "retryOnContentModified" [Text] ('R '[]) .+ 'R '[])))
-> Maybe RegularExpressionsClientCapabilities
-> Maybe MarkdownClientCapabilities
-> Maybe [PositionEncodingKind]
-> GeneralClientCapabilities
GeneralClientCapabilities 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
"staleRequestSupport" 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
"regularExpressions" 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
"markdown" 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
"positionEncodings"