Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher collects events from a fsnotify.Watcher and converts them into batched LSP [protocol.FileEvent]s.
func New ¶
func New(delay time.Duration, logger *slog.Logger, handler func([]protocol.FileEvent, error)) (*Watcher, error)
New creates a new file watcher and starts its event-handling loop. The Watcher.Close method must be called to clean up resources.
The provided handler is called sequentially with either a batch of file events or an error. Events and errors may be interleaved. The watcher blocks until the handler returns, so the handler should be fast and non-blocking.
Click to show internal directories.
Click to hide internal directories.