{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.ConfigurationParams 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.Internal.Types.ConfigurationItem
import qualified Language.LSP.Protocol.Types.Common
data ConfigurationParams = ConfigurationParams
{
ConfigurationParams -> [ConfigurationItem]
_items :: [Language.LSP.Protocol.Internal.Types.ConfigurationItem.ConfigurationItem]
}
deriving stock (Int -> ConfigurationParams -> ShowS
[ConfigurationParams] -> ShowS
ConfigurationParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationParams] -> ShowS
$cshowList :: [ConfigurationParams] -> ShowS
show :: ConfigurationParams -> String
$cshow :: ConfigurationParams -> String
showsPrec :: Int -> ConfigurationParams -> ShowS
$cshowsPrec :: Int -> ConfigurationParams -> ShowS
Show, ConfigurationParams -> ConfigurationParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationParams -> ConfigurationParams -> Bool
$c/= :: ConfigurationParams -> ConfigurationParams -> Bool
== :: ConfigurationParams -> ConfigurationParams -> Bool
$c== :: ConfigurationParams -> ConfigurationParams -> Bool
Eq, Eq ConfigurationParams
ConfigurationParams -> ConfigurationParams -> Bool
ConfigurationParams -> ConfigurationParams -> Ordering
ConfigurationParams -> ConfigurationParams -> ConfigurationParams
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 :: ConfigurationParams -> ConfigurationParams -> ConfigurationParams
$cmin :: ConfigurationParams -> ConfigurationParams -> ConfigurationParams
max :: ConfigurationParams -> ConfigurationParams -> ConfigurationParams
$cmax :: ConfigurationParams -> ConfigurationParams -> ConfigurationParams
>= :: ConfigurationParams -> ConfigurationParams -> Bool
$c>= :: ConfigurationParams -> ConfigurationParams -> Bool
> :: ConfigurationParams -> ConfigurationParams -> Bool
$c> :: ConfigurationParams -> ConfigurationParams -> Bool
<= :: ConfigurationParams -> ConfigurationParams -> Bool
$c<= :: ConfigurationParams -> ConfigurationParams -> Bool
< :: ConfigurationParams -> ConfigurationParams -> Bool
$c< :: ConfigurationParams -> ConfigurationParams -> Bool
compare :: ConfigurationParams -> ConfigurationParams -> Ordering
$ccompare :: ConfigurationParams -> ConfigurationParams -> Ordering
Ord, forall x. Rep ConfigurationParams x -> ConfigurationParams
forall x. ConfigurationParams -> Rep ConfigurationParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigurationParams x -> ConfigurationParams
$cfrom :: forall x. ConfigurationParams -> Rep ConfigurationParams x
Generic)
deriving anyclass (ConfigurationParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: ConfigurationParams -> ()
$crnf :: ConfigurationParams -> ()
NFData, Eq ConfigurationParams
Int -> ConfigurationParams -> Int
ConfigurationParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ConfigurationParams -> Int
$chash :: ConfigurationParams -> Int
hashWithSalt :: Int -> ConfigurationParams -> Int
$chashWithSalt :: Int -> ConfigurationParams -> Int
Hashable)
deriving forall ann. [ConfigurationParams] -> Doc ann
forall ann. ConfigurationParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ConfigurationParams] -> Doc ann
$cprettyList :: forall ann. [ConfigurationParams] -> Doc ann
pretty :: forall ann. ConfigurationParams -> Doc ann
$cpretty :: forall ann. ConfigurationParams -> Doc ann
Pretty via (ViaJSON ConfigurationParams)
instance Aeson.ToJSON ConfigurationParams where
toJSON :: ConfigurationParams -> Value
toJSON (ConfigurationParams [ConfigurationItem]
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
$ [[Key
"items" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [ConfigurationItem]
arg0]]
instance Aeson.FromJSON ConfigurationParams where
parseJSON :: Value -> Parser ConfigurationParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ConfigurationParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> [ConfigurationItem] -> ConfigurationParams
ConfigurationParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"items"