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