ghcide-2.7.0.0: The core of an IDE

Safe Haskell | None
Language | GHC2021

Development.IDE.Core.Debouncer

Synopsis

- data Debouncer k
- registerEvent :: Debouncer k -> Seconds -> k -> IO () -> IO ()
- newAsyncDebouncer :: (Eq k, Hashable k) => IO (Debouncer k)
- noopDebouncer :: Debouncer k

# Documentation

data Debouncer k #

A debouncer can be used to avoid triggering many events (e.g. diagnostics) for the same key (e.g. the same file) within a short timeframe. This is accomplished by delaying each event for a given time. If another event is registered for the same key within that timeframe, only the new event will fire.

We abstract over the debouncer used so we an use a proper debouncer in the IDE but disable debouncing in the DAML CLI compiler.

registerEvent :: Debouncer k -> Seconds -> k -> IO () -> IO () #

newAsyncDebouncer :: (Eq k, Hashable k) => IO (Debouncer k) #

Debouncer used in the IDE that delays events as expected.

noopDebouncer :: Debouncer k #

Debouncer used in the DAML CLI compiler that emits events immediately.