From 1f2fb4e27f8ba1cb7b1d96a332b7ffc2ee659921 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Aug 2018 12:51:46 +0300 Subject: move --- crates/server/src/server_world.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/server/src') diff --git a/crates/server/src/server_world.rs b/crates/server/src/server_world.rs index 6c85914ba..9ba7df0b8 100644 --- a/crates/server/src/server_world.rs +++ b/crates/server/src/server_world.rs @@ -5,7 +5,7 @@ use std::{ }; use languageserver_types::Url; -use libanalysis::{FileId, WorldState, Analysis}; +use libanalysis::{FileId, AnalysisHost, Analysis}; use { Result, @@ -15,7 +15,7 @@ use { #[derive(Debug)] pub struct ServerWorldState { - pub analysis: WorldState, + pub analysis_host: AnalysisHost, pub path_map: PathMap, pub mem_map: HashMap>, } @@ -29,7 +29,7 @@ pub struct ServerWorld { impl ServerWorldState { pub fn new() -> ServerWorldState { ServerWorldState { - analysis: WorldState::new(), + analysis_host: AnalysisHost::new(), path_map: PathMap::new(), mem_map: HashMap::new(), } @@ -58,20 +58,20 @@ impl ServerWorldState { } }); - self.analysis.change_files(changes); + self.analysis_host.change_files(changes); } pub fn add_mem_file(&mut self, path: PathBuf, text: String) { let file_id = self.path_map.get_or_insert(path); self.mem_map.insert(file_id, None); - self.analysis.change_file(file_id, Some(text)); + self.analysis_host.change_file(file_id, Some(text)); } pub fn change_mem_file(&mut self, path: &Path, text: String) -> Result<()> { let file_id = self.path_map.get_id(path).ok_or_else(|| { format_err!("change to unknown file: {}", path.display()) })?; - self.analysis.change_file(file_id, Some(text)); + self.analysis_host.change_file(file_id, Some(text)); Ok(()) } @@ -85,13 +85,13 @@ impl ServerWorldState { }; // Do this via file watcher ideally. let text = fs::read_to_string(path).ok(); - self.analysis.change_file(file_id, text); + self.analysis_host.change_file(file_id, text); Ok(()) } pub fn snapshot(&self) -> ServerWorld { ServerWorld { - analysis: self.analysis.analysis(self.path_map.clone()), + analysis: self.analysis_host.analysis(self.path_map.clone()), path_map: self.path_map.clone() } } -- cgit v1.2.3