Lines Matching refs:FileEvent
23 type FileEvent struct { struct
25 ProtocolEvent protocol.FileEvent argument
35 watchers []func(context.Context, []FileEvent)
68 func (w *Workdir) AddWatcher(watcher func(context.Context, []FileEvent)) {
131 func (w *Workdir) ChangeFilesOnDisk(ctx context.Context, events []FileEvent) error {
155 evts := []FileEvent{{
157 ProtocolEvent: protocol.FileEvent{
166 func (w *Workdir) sendEvents(ctx context.Context, evts []FileEvent) {
171 watchers := make([]func(context.Context, []FileEvent), len(w.watchers))
182 var evts []FileEvent
200 w.sendEvents(ctx, []FileEvent{evt})
204 func (w *Workdir) writeFile(ctx context.Context, path, content string) (FileEvent, error) {
208 return FileEvent{}, fmt.Errorf("checking if %q exists: %w", path, err)
217 return FileEvent{}, err
219 return FileEvent{
221 ProtocolEvent: protocol.FileEvent{
273 func (w *Workdir) pollFiles() ([]FileEvent, error) {
281 var evts []FileEvent
295 evts = append(evts, FileEvent{
297 ProtocolEvent: protocol.FileEvent{
305 evts = append(evts, FileEvent{
307 ProtocolEvent: protocol.FileEvent{