mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
fix spawn bug from calling
This commit is contained in:
parent
0666fa80ac
commit
c0a1328532
1 changed files with 7 additions and 2 deletions
|
@ -3100,8 +3100,13 @@ impl InlineAssistant {
|
||||||
project: ModelHandle<Project>,
|
project: ModelHandle<Project>,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
if let Some(semantic_index) = self.semantic_index.clone() {
|
if let Some(semantic_index) = SemanticIndex::global(cx) {
|
||||||
let _ = semantic_index.update(cx, |index, cx| index.index_project(project, cx));
|
cx.spawn(|_, mut cx| async move {
|
||||||
|
semantic_index
|
||||||
|
.update(&mut cx, |index, cx| index.index_project(project, cx))
|
||||||
|
.await
|
||||||
|
})
|
||||||
|
.detach_and_log_err(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
|
|
Loading…
Reference in a new issue