mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Downgrade notify and use RecommendedWatcher
This commit is contained in:
parent
df0936b4af
commit
5b0c86af7d
3 changed files with 8 additions and 28 deletions
|
@ -83,9 +83,10 @@ impl NotifyActor {
|
|||
self.watcher = None;
|
||||
if !config.watch.is_empty() {
|
||||
let (watcher_sender, watcher_receiver) = unbounded();
|
||||
let watcher = log_notify_error(RecommendedWatcher::new(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
let watcher =
|
||||
log_notify_error(RecommendedWatcher::new_immediate(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
}
|
||||
|
||||
|
@ -214,7 +215,7 @@ impl NotifyActor {
|
|||
|
||||
fn watch(&mut self, path: AbsPathBuf) {
|
||||
if let Some((watcher, _)) = &mut self.watcher {
|
||||
log_notify_error(watcher.watch(path.as_ref(), RecursiveMode::NonRecursive));
|
||||
log_notify_error(watcher.watch(&path, RecursiveMode::NonRecursive));
|
||||
}
|
||||
}
|
||||
fn send(&mut self, msg: loader::Message) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue