Skip to content

Commit

Permalink
Automatically refresh content graph after creating project inside wor…
Browse files Browse the repository at this point in the history
…kspace
  • Loading branch information
SpontanCombust committed Jun 15, 2024
1 parent 2912820 commit 413c565
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/lsp/src/providers/custom/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,18 @@ impl LangaugeServerCustomProjects for Backend {
})
}

//TODO reload content graph if manifest was created in workspace

let created_in_workspace = self.workspace_roots
.read().await
.iter()
.any(|root| project_dir.starts_with(root));

if created_in_workspace {
let backend = self.clone();
tokio::spawn(async move {
backend.build_content_graph(false).await;
});
}

Ok(requests::projects::create::Response {
manifest_uri: manifest_path.into()
Expand Down

0 comments on commit 413c565

Please sign in to comment.