diff options
Diffstat (limited to 'crates/rust-analyzer/src/reload.rs')
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 0ae2758cc..7a53e4a8b 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -147,6 +147,7 @@ impl GlobalState { | |||
147 | 147 | ||
148 | self.task_pool.handle.spawn_with_sender({ | 148 | self.task_pool.handle.spawn_with_sender({ |
149 | let linked_projects = self.config.linked_projects(); | 149 | let linked_projects = self.config.linked_projects(); |
150 | let detached_files = self.config.detached_files().to_vec(); | ||
150 | let cargo_config = self.config.cargo(); | 151 | let cargo_config = self.config.cargo(); |
151 | 152 | ||
152 | move |sender| { | 153 | move |sender| { |
@@ -161,7 +162,7 @@ impl GlobalState { | |||
161 | 162 | ||
162 | sender.send(Task::FetchWorkspace(ProjectWorkspaceProgress::Begin)).unwrap(); | 163 | sender.send(Task::FetchWorkspace(ProjectWorkspaceProgress::Begin)).unwrap(); |
163 | 164 | ||
164 | let workspaces = linked_projects | 165 | let mut workspaces = linked_projects |
165 | .iter() | 166 | .iter() |
166 | .map(|project| match project { | 167 | .map(|project| match project { |
167 | LinkedProject::ProjectManifest(manifest) => { | 168 | LinkedProject::ProjectManifest(manifest) => { |
@@ -180,6 +181,11 @@ impl GlobalState { | |||
180 | }) | 181 | }) |
181 | .collect::<Vec<_>>(); | 182 | .collect::<Vec<_>>(); |
182 | 183 | ||
184 | if !detached_files.is_empty() { | ||
185 | workspaces | ||
186 | .push(project_model::ProjectWorkspace::load_detached_files(detached_files)); | ||
187 | } | ||
188 | |||
183 | log::info!("did fetch workspaces {:?}", workspaces); | 189 | log::info!("did fetch workspaces {:?}", workspaces); |
184 | sender | 190 | sender |
185 | .send(Task::FetchWorkspace(ProjectWorkspaceProgress::End(workspaces))) | 191 | .send(Task::FetchWorkspace(ProjectWorkspaceProgress::End(workspaces))) |
@@ -407,6 +413,7 @@ impl GlobalState { | |||
407 | _ => None, | 413 | _ => None, |
408 | } | 414 | } |
409 | } | 415 | } |
416 | ProjectWorkspace::DetachedFiles { .. } => None, | ||
410 | }) | 417 | }) |
411 | .map(|(id, root)| { | 418 | .map(|(id, root)| { |
412 | let sender = sender.clone(); | 419 | let sender = sender.clone(); |