diff options
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 728dc9962..9a9a6547a 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -26,6 +26,7 @@ use crate::{ | |||
26 | to_proto::url_from_abs_path, | 26 | to_proto::url_from_abs_path, |
27 | Result, | 27 | Result, |
28 | }; | 28 | }; |
29 | use ra_prof::profile; | ||
29 | 30 | ||
30 | #[derive(Eq, PartialEq, Copy, Clone)] | 31 | #[derive(Eq, PartialEq, Copy, Clone)] |
31 | pub(crate) enum Status { | 32 | pub(crate) enum Status { |
@@ -122,6 +123,7 @@ impl GlobalState { | |||
122 | } | 123 | } |
123 | 124 | ||
124 | pub(crate) fn process_changes(&mut self) -> bool { | 125 | pub(crate) fn process_changes(&mut self) -> bool { |
126 | let _p = profile("GlobalState::process_changes"); | ||
125 | let mut fs_changes = Vec::new(); | 127 | let mut fs_changes = Vec::new(); |
126 | let mut has_fs_changes = false; | 128 | let mut has_fs_changes = false; |
127 | 129 | ||
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index a425320f6..ffe234a5b 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -14,9 +14,11 @@ use crate::{ | |||
14 | lsp_ext, | 14 | lsp_ext, |
15 | main_loop::Task, | 15 | main_loop::Task, |
16 | }; | 16 | }; |
17 | use ra_prof::profile; | ||
17 | 18 | ||
18 | impl GlobalState { | 19 | impl GlobalState { |
19 | pub(crate) fn update_configuration(&mut self, config: Config) { | 20 | pub(crate) fn update_configuration(&mut self, config: Config) { |
21 | let _p = profile("GlobalState::update_configuration"); | ||
20 | let old_config = mem::replace(&mut self.config, config); | 22 | let old_config = mem::replace(&mut self.config, config); |
21 | if self.config.lru_capacity != old_config.lru_capacity { | 23 | if self.config.lru_capacity != old_config.lru_capacity { |
22 | self.analysis_host.update_lru_capacity(old_config.lru_capacity); | 24 | self.analysis_host.update_lru_capacity(old_config.lru_capacity); |
@@ -114,6 +116,7 @@ impl GlobalState { | |||
114 | }); | 116 | }); |
115 | } | 117 | } |
116 | pub(crate) fn switch_workspaces(&mut self, workspaces: Vec<anyhow::Result<ProjectWorkspace>>) { | 118 | pub(crate) fn switch_workspaces(&mut self, workspaces: Vec<anyhow::Result<ProjectWorkspace>>) { |
119 | let _p = profile("GlobalState::switch_workspaces"); | ||
117 | log::info!("reloading projects: {:?}", self.config.linked_projects); | 120 | log::info!("reloading projects: {:?}", self.config.linked_projects); |
118 | 121 | ||
119 | let mut has_errors = false; | 122 | let mut has_errors = false; |
@@ -302,6 +305,7 @@ pub(crate) struct SourceRootConfig { | |||
302 | 305 | ||
303 | impl SourceRootConfig { | 306 | impl SourceRootConfig { |
304 | pub(crate) fn partition(&self, vfs: &vfs::Vfs) -> Vec<SourceRoot> { | 307 | pub(crate) fn partition(&self, vfs: &vfs::Vfs) -> Vec<SourceRoot> { |
308 | let _p = profile("SourceRootConfig::partition"); | ||
305 | self.fsc | 309 | self.fsc |
306 | .partition(vfs) | 310 | .partition(vfs) |
307 | .into_iter() | 311 | .into_iter() |