diff options
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r-- | crates/ra_lsp_server/src/server_world.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs index 865f7c491..c4cdf83d4 100644 --- a/crates/ra_lsp_server/src/server_world.rs +++ b/crates/ra_lsp_server/src/server_world.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | use std::{ | 1 | use std::{ |
2 | fs, | 2 | fs, |
3 | path::{PathBuf, Path}, | 3 | path::{PathBuf, Path}, |
4 | collections::HashMap, | ||
5 | sync::Arc, | 4 | sync::Arc, |
6 | }; | 5 | }; |
7 | 6 | ||
7 | use rustc_hash::FxHashMap; | ||
8 | use languageserver_types::Url; | 8 | use languageserver_types::Url; |
9 | use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver}; | 9 | use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver}; |
10 | 10 | ||
@@ -20,7 +20,7 @@ pub struct ServerWorldState { | |||
20 | pub workspaces: Arc<Vec<CargoWorkspace>>, | 20 | pub workspaces: Arc<Vec<CargoWorkspace>>, |
21 | pub analysis_host: AnalysisHost, | 21 | pub analysis_host: AnalysisHost, |
22 | pub path_map: PathMap, | 22 | pub path_map: PathMap, |
23 | pub mem_map: HashMap<FileId, Option<String>>, | 23 | pub mem_map: FxHashMap<FileId, Option<String>>, |
24 | } | 24 | } |
25 | 25 | ||
26 | #[derive(Clone)] | 26 | #[derive(Clone)] |
@@ -36,7 +36,7 @@ impl ServerWorldState { | |||
36 | workspaces: Arc::new(Vec::new()), | 36 | workspaces: Arc::new(Vec::new()), |
37 | analysis_host: AnalysisHost::new(), | 37 | analysis_host: AnalysisHost::new(), |
38 | path_map: PathMap::new(), | 38 | path_map: PathMap::new(), |
39 | mem_map: HashMap::new(), | 39 | mem_map: FxHashMap::default(), |
40 | } | 40 | } |
41 | } | 41 | } |
42 | pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) { | 42 | pub fn apply_fs_changes(&mut self, events: Vec<FileEvent>) { |
@@ -121,7 +121,7 @@ impl ServerWorldState { | |||
121 | Ok(file_id) | 121 | Ok(file_id) |
122 | } | 122 | } |
123 | pub fn set_workspaces(&mut self, ws: Vec<CargoWorkspace>) { | 123 | pub fn set_workspaces(&mut self, ws: Vec<CargoWorkspace>) { |
124 | let mut crate_roots = HashMap::new(); | 124 | let mut crate_roots = FxHashMap::default(); |
125 | ws.iter() | 125 | ws.iter() |
126 | .flat_map(|ws| { | 126 | .flat_map(|ws| { |
127 | ws.packages() | 127 | ws.packages() |