aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/reload.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-05-23 18:56:54 +0100
committerKirill Bulatov <[email protected]>2021-05-23 20:46:20 +0100
commitde090749d9643a8035135092e2546cd0ddb854a6 (patch)
tree01f0564f53a7763ecf28a46860997c294a042f3c /crates/rust-analyzer/src/reload.rs
parent695569d9784b4a7d6e91451a0cc354f8bd009b59 (diff)
Drag detached files towards loading
Diffstat (limited to 'crates/rust-analyzer/src/reload.rs')
-rw-r--r--crates/rust-analyzer/src/reload.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
index cfa95275d..7a53e4a8b 100644
--- a/crates/rust-analyzer/src/reload.rs
+++ b/crates/rust-analyzer/src/reload.rs
@@ -146,8 +146,8 @@ impl GlobalState {
146 log::info!("will fetch workspaces"); 146 log::info!("will fetch workspaces");
147 147
148 self.task_pool.handle.spawn_with_sender({ 148 self.task_pool.handle.spawn_with_sender({
149 // TODO kb reload workspace here?
150 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();
151 let cargo_config = self.config.cargo(); 151 let cargo_config = self.config.cargo();
152 152
153 move |sender| { 153 move |sender| {
@@ -162,7 +162,7 @@ impl GlobalState {
162 162
163 sender.send(Task::FetchWorkspace(ProjectWorkspaceProgress::Begin)).unwrap(); 163 sender.send(Task::FetchWorkspace(ProjectWorkspaceProgress::Begin)).unwrap();
164 164
165 let workspaces = linked_projects 165 let mut workspaces = linked_projects
166 .iter() 166 .iter()
167 .map(|project| match project { 167 .map(|project| match project {
168 LinkedProject::ProjectManifest(manifest) => { 168 LinkedProject::ProjectManifest(manifest) => {
@@ -181,6 +181,11 @@ impl GlobalState {
181 }) 181 })
182 .collect::<Vec<_>>(); 182 .collect::<Vec<_>>();
183 183
184 if !detached_files.is_empty() {
185 workspaces
186 .push(project_model::ProjectWorkspace::load_detached_files(detached_files));
187 }
188
184 log::info!("did fetch workspaces {:?}", workspaces); 189 log::info!("did fetch workspaces {:?}", workspaces);
185 sender 190 sender
186 .send(Task::FetchWorkspace(ProjectWorkspaceProgress::End(workspaces))) 191 .send(Task::FetchWorkspace(ProjectWorkspaceProgress::End(workspaces)))
@@ -408,6 +413,7 @@ impl GlobalState {
408 _ => None, 413 _ => None,
409 } 414 }
410 } 415 }
416 ProjectWorkspace::DetachedFiles { .. } => None,
411 }) 417 })
412 .map(|(id, root)| { 418 .map(|(id, root)| {
413 let sender = sender.clone(); 419 let sender = sender.clone();