mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Don't spawn notify unnecessary
This commit is contained in:
parent
65984773d3
commit
dac9a4cebd
3 changed files with 8 additions and 6 deletions
|
@ -182,6 +182,7 @@ impl GlobalState {
|
|||
}
|
||||
},
|
||||
};
|
||||
|
||||
let watch = match self.config.files.watcher {
|
||||
FilesWatcher::Client => vec![],
|
||||
FilesWatcher::Notify => project_folders.watch,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//! See `Include`.
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use globset::{Glob, GlobSet, GlobSetBuilder};
|
||||
|
|
|
@ -82,11 +82,13 @@ impl NotifyActor {
|
|||
Event::Message(msg) => match msg {
|
||||
Message::Config(config) => {
|
||||
self.watcher = None;
|
||||
let (watcher_sender, watcher_receiver) = unbounded();
|
||||
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
if !config.watch.is_empty() {
|
||||
let (watcher_sender, watcher_receiver) = unbounded();
|
||||
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
||||
watcher_sender.send(event).unwrap()
|
||||
}));
|
||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||
}
|
||||
|
||||
let n_total = config.load.len();
|
||||
self.send(loader::Message::Progress { n_total, n_done: 0 });
|
||||
|
|
Loading…
Reference in a new issue