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