aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_vfs/src/io.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_vfs/src/io.rs')
-rw-r--r--crates/ra_vfs/src/io.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_vfs/src/io.rs b/crates/ra_vfs/src/io.rs
index a0c87fb25..e5d5c6463 100644
--- a/crates/ra_vfs/src/io.rs
+++ b/crates/ra_vfs/src/io.rs
@@ -15,7 +15,8 @@ pub(crate) enum Task {
15 path: PathBuf, 15 path: PathBuf,
16 filter: Box<Fn(&DirEntry) -> bool + Send>, 16 filter: Box<Fn(&DirEntry) -> bool + Send>,
17 }, 17 },
18 LoadChange(crate::watcher::WatcherChange), 18 HandleChange(WatcherChange),
19 LoadChange(WatcherChange),
19} 20}
20 21
21#[derive(Debug)] 22#[derive(Debug)]
@@ -63,6 +64,10 @@ fn handle_task(task: Task) -> TaskResult {
63 log::debug!("... loaded {}", path.as_path().display()); 64 log::debug!("... loaded {}", path.as_path().display());
64 TaskResult::AddRoot(AddRootResult { root, files }) 65 TaskResult::AddRoot(AddRootResult { root, files })
65 } 66 }
67 Task::HandleChange(change) => {
68 // forward as is because Vfs has to decide if we should load it
69 TaskResult::HandleChange(change)
70 }
66 Task::LoadChange(change) => { 71 Task::LoadChange(change) => {
67 log::debug!("loading {:?} ...", change); 72 log::debug!("loading {:?} ...", change);
68 let data = load_change(change); 73 let data = load_change(change);
@@ -107,7 +112,7 @@ fn load_change(change: WatcherChange) -> Option<WatcherChangeData> {
107 let text = match fs::read_to_string(&path) { 112 let text = match fs::read_to_string(&path) {
108 Ok(text) => text, 113 Ok(text) => text,
109 Err(e) => { 114 Err(e) => {
110 log::warn!("watcher error: {}", e); 115 log::warn!("watcher error \"{}\": {}", path.display(), e);
111 return None; 116 return None;
112 } 117 }
113 }; 118 };
@@ -117,7 +122,7 @@ fn load_change(change: WatcherChange) -> Option<WatcherChangeData> {
117 let text = match fs::read_to_string(&path) { 122 let text = match fs::read_to_string(&path) {
118 Ok(text) => text, 123 Ok(text) => text,
119 Err(e) => { 124 Err(e) => {
120 log::warn!("watcher error: {}", e); 125 log::warn!("watcher error \"{}\": {}", path.display(), e);
121 return None; 126 return None;
122 } 127 }
123 }; 128 };