correctly setup path-map for fs-changes

This commit is contained in:
Aleksey Kladov 2018-09-12 11:19:19 +03:00
parent e240360ee2
commit ccc75675b6

View file

@ -39,8 +39,8 @@ impl ServerWorldState {
mem_map: HashMap::new(), mem_map: HashMap::new(),
} }
} }
pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) { pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) {
{
let pm = &mut self.path_map; let pm = &mut self.path_map;
let mm = &mut self.mem_map; let mm = &mut self.mem_map;
let changes = events.into_iter() let changes = events.into_iter()
@ -61,9 +61,10 @@ impl ServerWorldState {
Some((id, text)) Some((id, text))
} }
}); });
self.analysis_host.change_files(changes); self.analysis_host.change_files(changes);
} }
self.analysis_host.set_file_resolver(Arc::new(self.path_map.clone()));
}
pub fn events_to_files(&mut self, events: Vec<FileEvent>) -> (Vec<(FileId, String)>, Arc<FileResolver>) { pub fn events_to_files(&mut self, events: Vec<FileEvent>) -> (Vec<(FileId, String)>, Arc<FileResolver>) {
let files = { let files = {
let pm = &mut self.path_map; let pm = &mut self.path_map;