diff --git a/Cargo.lock b/Cargo.lock index a95da602..e088529d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,6 +94,7 @@ dependencies = [ "line-index", "log", "notify", + "notify-debouncer-full", "once_cell", "parser", "percent-encoding", @@ -146,9 +147,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bstr" @@ -596,11 +597,11 @@ dependencies = [ [[package]] name = "file-id" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6584280525fb2059cba3db2c04abf947a1a29a45ddae89f3870f8281704fafc9" +checksum = "6bc904b9bbefcadbd8e3a9fb0d464a9b979de6324c03b3c663e8994f46a5be36" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -776,11 +777,11 @@ dependencies = [ [[package]] name = "inotify" -version = "0.9.6" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.8.0", "inotify-sys", "libc", ] @@ -899,7 +900,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.8.0", "libc", ] @@ -1034,14 +1035,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1065,12 +1066,11 @@ dependencies = [ [[package]] name = "notify" -version = "6.1.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.4.0", - "crossbeam-channel", + "bitflags 2.8.0", "filetime", "fsevent-sys", "inotify", @@ -1078,24 +1078,30 @@ dependencies = [ "libc", "log", "mio", + "notify-types", "walkdir", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "notify-debouncer-full" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fd166739789c9ff169e654dc1501373db9d80a4c3f972817c8a4d7cf8f34e" +checksum = "d2d88b1a7538054351c8258338df7c931a590513fb3745e8c15eb9ff4199b8d1" dependencies = [ - "crossbeam-channel", "file-id", "log", "notify", - "parking_lot", + "notify-types", "walkdir", ] +[[package]] +name = "notify-types" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + [[package]] name = "num-traits" version = "0.2.16" @@ -1435,7 +1441,7 @@ version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", diff --git a/Cargo.toml b/Cargo.toml index bcb3b501..10ed4290 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,8 @@ crossbeam-channel = "0.5.14" expect-test = "1.5.1" itertools = "0.13.0" log = "0.4.25" -notify = "6.1.1" +notify = "8.0.0" +notify-debouncer-full = "0.5.0" once_cell = "1.20.2" regex = "1.11.1" rowan = "0.15.16" diff --git a/crates/base-db/Cargo.toml b/crates/base-db/Cargo.toml index 95691e23..f3b57ed9 100644 --- a/crates/base-db/Cargo.toml +++ b/crates/base-db/Cargo.toml @@ -13,6 +13,7 @@ distro = { path = "../distro" } itertools.workspace = true line-index = { path = "../line-index" } log.workspace = true +notify-debouncer-full.workspace = true notify.workspace = true once_cell.workspace = true parser = { path = "../parser" } diff --git a/crates/base-db/src/deps/discover.rs b/crates/base-db/src/deps/discover.rs index 3039d7b0..c6f1b7ae 100644 --- a/crates/base-db/src/deps/discover.rs +++ b/crates/base-db/src/deps/discover.rs @@ -8,11 +8,14 @@ use crate::Workspace; use super::ProjectRoot; -pub fn watch( +pub fn watch( workspace: &mut Workspace, - watcher: &mut dyn notify::Watcher, + watcher: &mut notify_debouncer_full::Debouncer, watched_dirs: &mut FxHashSet, -) { +) where + T: notify::Watcher, + C: notify_debouncer_full::FileIdCache, +{ let roots = workspace .iter() .filter_map(|document| document.dir.as_ref()) diff --git a/crates/texlab/Cargo.toml b/crates/texlab/Cargo.toml index dc465b02..77dbed30 100644 --- a/crates/texlab/Cargo.toml +++ b/crates/texlab/Cargo.toml @@ -45,7 +45,7 @@ links = { path = "../links" } log.workspace = true lsp-server = "0.7.8" lsp-types = "0.95.1" -notify-debouncer-full = "0.3.2" +notify-debouncer-full.workspace = true notify.workspace = true parking_lot = "0.12.3" parser = { path = "../parser" } diff --git a/crates/texlab/src/server.rs b/crates/texlab/src/server.rs index 4a0d795a..a42939ae 100644 --- a/crates/texlab/src/server.rs +++ b/crates/texlab/src/server.rs @@ -19,7 +19,7 @@ use line_index::LineCol; use lsp_server::{Connection, ErrorCode, Message, RequestId}; use lsp_types::{notification::*, request::*, *}; use notify::event::ModifyKind; -use notify_debouncer_full::{DebouncedEvent, Debouncer, FileIdMap}; +use notify_debouncer_full::{DebouncedEvent, Debouncer, RecommendedCache}; use parking_lot::{Mutex, RwLock}; use rustc_hash::FxHashSet; use serde::{de::DeserializeOwned, Serialize}; @@ -1124,7 +1124,7 @@ impl Server { } struct FileWatcher { - watcher: Debouncer, + watcher: Debouncer, watched_dirs: FxHashSet, } @@ -1143,6 +1143,6 @@ impl FileWatcher { } pub fn watch(&mut self, workspace: &mut Workspace) { - deps::watch(workspace, self.watcher.watcher(), &mut self.watched_dirs); + deps::watch(workspace, &mut self.watcher, &mut self.watched_dirs); } }