diff options
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index e5a0603d1..4f984ebc7 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -113,7 +113,6 @@ enum Event { | |||
113 | Msg(RawMessage), | 113 | Msg(RawMessage), |
114 | Task(Task), | 114 | Task(Task), |
115 | Vfs(VfsTask), | 115 | Vfs(VfsTask), |
116 | Watcher(WatcherChange), | ||
117 | Lib(LibraryData), | 116 | Lib(LibraryData), |
118 | } | 117 | } |
119 | 118 | ||
@@ -150,7 +149,6 @@ impl fmt::Debug for Event { | |||
150 | Event::Task(it) => fmt::Debug::fmt(it, f), | 149 | Event::Task(it) => fmt::Debug::fmt(it, f), |
151 | Event::Vfs(it) => fmt::Debug::fmt(it, f), | 150 | Event::Vfs(it) => fmt::Debug::fmt(it, f), |
152 | Event::Lib(it) => fmt::Debug::fmt(it, f), | 151 | Event::Lib(it) => fmt::Debug::fmt(it, f), |
153 | Event::Watcher(it) => fmt::Debug::fmt(it, f), | ||
154 | } | 152 | } |
155 | } | 153 | } |
156 | } | 154 | } |
@@ -185,10 +183,6 @@ fn main_loop_inner( | |||
185 | Ok(task) => Event::Vfs(task), | 183 | Ok(task) => Event::Vfs(task), |
186 | Err(RecvError) => bail!("vfs died"), | 184 | Err(RecvError) => bail!("vfs died"), |
187 | }, | 185 | }, |
188 | recv(state.vfs.read().change_receiver()) -> change => match change { | ||
189 | Ok(change) => Event::Watcher(change), | ||
190 | Err(RecvError) => bail!("vfs watcher died"), | ||
191 | }, | ||
192 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()) | 186 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()) |
193 | }; | 187 | }; |
194 | log::info!("loop_turn = {:?}", event); | 188 | log::info!("loop_turn = {:?}", event); |
@@ -200,10 +194,6 @@ fn main_loop_inner( | |||
200 | state.vfs.write().handle_task(task); | 194 | state.vfs.write().handle_task(task); |
201 | state_changed = true; | 195 | state_changed = true; |
202 | } | 196 | } |
203 | Event::Watcher(change) => { | ||
204 | state.vfs.write().handle_change(change); | ||
205 | state_changed = true; | ||
206 | } | ||
207 | Event::Lib(lib) => { | 197 | Event::Lib(lib) => { |
208 | feedback(internal_mode, "library loaded", msg_sender); | 198 | feedback(internal_mode, "library loaded", msg_sender); |
209 | state.add_lib(lib); | 199 | state.add_lib(lib); |
@@ -375,7 +365,7 @@ fn on_notification( | |||
375 | if let Some(file_id) = state | 365 | if let Some(file_id) = state |
376 | .vfs | 366 | .vfs |
377 | .write() | 367 | .write() |
378 | .add_file_overlay(&path, Some(params.text_document.text)) | 368 | .add_file_overlay(&path, params.text_document.text) |
379 | { | 369 | { |
380 | subs.add_sub(FileId(file_id.0.into())); | 370 | subs.add_sub(FileId(file_id.0.into())); |
381 | } | 371 | } |
@@ -394,10 +384,7 @@ fn on_notification( | |||
394 | .pop() | 384 | .pop() |
395 | .ok_or_else(|| format_err!("empty changes"))? | 385 | .ok_or_else(|| format_err!("empty changes"))? |
396 | .text; | 386 | .text; |
397 | state | 387 | state.vfs.write().change_file_overlay(path.as_path(), text); |
398 | .vfs | ||
399 | .write() | ||
400 | .change_file_overlay(path.as_path(), Some(text)); | ||
401 | return Ok(()); | 388 | return Ok(()); |
402 | } | 389 | } |
403 | Err(not) => not, | 390 | Err(not) => not, |