Skip to content

Make watch module event handling cross-platform #57

@coderabbitai

Description

@coderabbitai

Problem

The watch module currently uses EventKind::Access(AccessKind::Close(AccessMode::Write)) to detect file changes, which relies on inotify's IN_CLOSE_WRITE capability. This event type is Linux-only and won't trigger on macOS (FSEvents) or Windows (ReadDirectoryChangesW).

Proposed Solution

Replace the current event matching with EventKind::Modify(ModifyKind::Data(_)) for cross-platform support. Consider adding debouncing to handle multiple Modify events that may fire for a single save operation.

References

Affected File

rs/src/modules/watch.rs (lines 32-39)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions