diff options
Diffstat (limited to 'crates/server/src')
-rw-r--r-- | crates/server/src/server_world.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/server/src/server_world.rs b/crates/server/src/server_world.rs index 1593cd59f..1982e727f 100644 --- a/crates/server/src/server_world.rs +++ b/crates/server/src/server_world.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | use std::{ | 1 | use std::{ |
2 | fs, | ||
2 | path::{PathBuf, Path}, | 3 | path::{PathBuf, Path}, |
3 | collections::HashMap, | 4 | collections::HashMap, |
4 | }; | 5 | }; |
@@ -78,10 +79,12 @@ impl ServerWorldState { | |||
78 | let file_id = self.path_map.get_id(path).ok_or_else(|| { | 79 | let file_id = self.path_map.get_id(path).ok_or_else(|| { |
79 | format_err!("change to unknown file: {}", path.display()) | 80 | format_err!("change to unknown file: {}", path.display()) |
80 | })?; | 81 | })?; |
81 | let text = match self.mem_map.remove(&file_id) { | 82 | match self.mem_map.remove(&file_id) { |
82 | Some(text) => text, | 83 | Some(_) => (), |
83 | None => bail!("unmatched close notification"), | 84 | None => bail!("unmatched close notification"), |
84 | }; | 85 | }; |
86 | // Do this via file watcher ideally. | ||
87 | let text = fs::read_to_string(path).ok(); | ||
85 | self.analysis.change_file(file_id, text); | 88 | self.analysis.change_file(file_id, text); |
86 | Ok(()) | 89 | Ok(()) |
87 | } | 90 | } |