From c19b24965718dca39713afd43d3bdec0d343aa7a Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 7 Mar 2026 10:30:09 -0600 Subject: [PATCH] Update TODO.txt and refine VFS watch logic in ServeSession - Added a new entry in TODO.txt to follow up with Coelho on outstanding tasks. - Simplified VFS watch logic to ensure both files and directories are monitored, addressing potential conflicts on macOS and improving overall watch reliability. --- TODO.txt | 2 ++ src/serve_session.rs | 18 ++++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TODO.txt b/TODO.txt index 475948a8..dae15064 100644 --- a/TODO.txt +++ b/TODO.txt @@ -107,3 +107,5 @@ and make luau-lsp actually use the 'atlas' cli... [two way sync] so the plugin isnt respecting two-way sync for glob ignore basically if a new script is on studio that isn't in atlas but even though it's glob ignored, it still tries to two-way sync it over and say there has been a change + +[hit up coelho] \ No newline at end of file diff --git a/src/serve_session.rs b/src/serve_session.rs index 1a53f5b6..fb0f1427 100644 --- a/src/serve_session.rs +++ b/src/serve_session.rs @@ -402,16 +402,14 @@ impl ServeSession { .filter_entry(&passes_ignore) .flatten() { - // On macOS kqueue, non-recursive directory watches only - // fire for structural changes (child added/removed), NOT - // for child file content modifications. Individual file - // watches are required to detect edits. On Linux/Windows, - // directory watches already cover child file events so - // file watches would be redundant. - if entry.file_type().is_dir() || cfg!(target_os = "macos") { - let _ = vfs.watch(entry.path()); - watch_count += 1; - } + // Watch both files and directories. On macOS kqueue, + // file watches are required because directory watches + // only fire for structural changes. On Linux/Windows, + // file watches prevent a debouncer race where read_raw's + // auto-registered file watch conflicts with the directory + // watch during rename-overwrite (atomic save pattern). + let _ = vfs.watch(entry.path()); + watch_count += 1; } } // Watch project folder non-recursively for project file edits.