module Language.LSP.Protocol.Types.WatchKinds where
import Data.Set (Set, toList)
import Language.LSP.Protocol.Internal.Types (WatchKind (..))
import Language.LSP.Protocol.Types.LspEnum (fromOpenEnumBaseType, toEnumBaseType)
containsCreate :: WatchKind -> Bool
containsCreate :: WatchKind -> Bool
containsCreate WatchKind
WatchKind_Create = Bool
True
containsCreate (WatchKind_Custom UInt
3) = Bool
True
containsCreate (WatchKind_Custom UInt
5) = Bool
True
containsCreate (WatchKind_Custom UInt
7) = Bool
True
containsCreate WatchKind
_ = Bool
False
containsChange :: WatchKind -> Bool
containsChange :: WatchKind -> Bool
containsChange WatchKind
WatchKind_Change = Bool
True
containsChange (WatchKind_Custom UInt
3) = Bool
True
containsChange (WatchKind_Custom UInt
6) = Bool
True
containsChange (WatchKind_Custom UInt
7) = Bool
True
containsChange WatchKind
_ = Bool
False
containsDelete :: WatchKind -> Bool
containsDelete :: WatchKind -> Bool
containsDelete WatchKind
WatchKind_Delete = Bool
True
containsDelete (WatchKind_Custom UInt
5) = Bool
True
containsDelete (WatchKind_Custom UInt
6) = Bool
True
containsDelete (WatchKind_Custom UInt
7) = Bool
True
containsDelete WatchKind
_ = Bool
False
combineWatchKinds :: Set WatchKind -> WatchKind
combineWatchKinds :: Set WatchKind -> WatchKind
combineWatchKinds Set WatchKind
s = forall a. LspOpenEnum a => EnumBaseType a -> a
fromOpenEnumBaseType forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum forall a b. (a -> b) -> a -> b
$ forall a. LspEnum a => a -> EnumBaseType a
toEnumBaseType forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Set a -> [a]
toList Set WatchKind
s