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 {
|
let watch = match self.config.files.watcher {
|
||||||
FilesWatcher::Client => vec![],
|
FilesWatcher::Client => vec![],
|
||||||
FilesWatcher::Notify => project_folders.watch,
|
FilesWatcher::Notify => project_folders.watch,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
//! See `Include`.
|
//! See `Include`.
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
use globset::{Glob, GlobSet, GlobSetBuilder};
|
use globset::{Glob, GlobSet, GlobSetBuilder};
|
||||||
|
|
|
@ -82,11 +82,13 @@ impl NotifyActor {
|
||||||
Event::Message(msg) => match msg {
|
Event::Message(msg) => match msg {
|
||||||
Message::Config(config) => {
|
Message::Config(config) => {
|
||||||
self.watcher = None;
|
self.watcher = None;
|
||||||
let (watcher_sender, watcher_receiver) = unbounded();
|
if !config.watch.is_empty() {
|
||||||
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
let (watcher_sender, watcher_receiver) = unbounded();
|
||||||
watcher_sender.send(event).unwrap()
|
let watcher = log_notify_error(Watcher::new_immediate(move |event| {
|
||||||
}));
|
watcher_sender.send(event).unwrap()
|
||||||
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
}));
|
||||||
|
self.watcher = watcher.map(|it| (it, watcher_receiver));
|
||||||
|
}
|
||||||
|
|
||||||
let n_total = config.load.len();
|
let n_total = config.load.len();
|
||||||
self.send(loader::Message::Progress { n_total, n_done: 0 });
|
self.send(loader::Message::Progress { n_total, n_done: 0 });
|
||||||
|
|
Loading…
Reference in a new issue