This commit is contained in:
parent
f7aa90b2ec
commit
151f330dc5
3 changed files with 8 additions and 7 deletions
|
@ -1774,7 +1774,7 @@ impl Editor {
|
||||||
) -> Self {
|
) -> Self {
|
||||||
debug_assert!(
|
debug_assert!(
|
||||||
display_map.is_none() || mode.is_minimap(),
|
display_map.is_none() || mode.is_minimap(),
|
||||||
"Providing a display map for a new editor is only intended for the minimap and might have unindended side effects otherwise!"
|
"Providing a display map for a new editor is only intended for the minimap and might have unintended side effects otherwise!"
|
||||||
);
|
);
|
||||||
|
|
||||||
let full_mode = mode.is_full();
|
let full_mode = mode.is_full();
|
||||||
|
@ -8235,8 +8235,7 @@ impl Editor {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Try to find a closest, enclosing node using tree-sitter that has a
|
// Try to find a closest, enclosing node using tree-sitter that has a task
|
||||||
// task
|
|
||||||
let Some((buffer, buffer_row, tasks)) = self
|
let Some((buffer, buffer_row, tasks)) = self
|
||||||
.find_enclosing_node_task(cx)
|
.find_enclosing_node_task(cx)
|
||||||
// Or find the task that's closest in row-distance.
|
// Or find the task that's closest in row-distance.
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl Workspace {
|
||||||
|
|
||||||
if let Some(terminal_provider) = self.terminal_provider.as_ref() {
|
if let Some(terminal_provider) = self.terminal_provider.as_ref() {
|
||||||
let task_status = terminal_provider.spawn(spawn_in_terminal, window, cx);
|
let task_status = terminal_provider.spawn(spawn_in_terminal, window, cx);
|
||||||
cx.background_spawn(async move {
|
let task = cx.background_spawn(async move {
|
||||||
match task_status.await {
|
match task_status.await {
|
||||||
Some(Ok(status)) => {
|
Some(Ok(status)) => {
|
||||||
if status.success() {
|
if status.success() {
|
||||||
|
@ -82,11 +82,11 @@ impl Workspace {
|
||||||
log::debug!("Task spawn failed, code: {:?}", status.code());
|
log::debug!("Task spawn failed, code: {:?}", status.code());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(Err(e)) => log::error!("Task spawn failed: {e}"),
|
Some(Err(e)) => log::error!("Task spawn failed: {e:#}"),
|
||||||
None => log::debug!("Task spawn got cancelled"),
|
None => log::debug!("Task spawn got cancelled"),
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.detach();
|
self.scheduled_tasks.push(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1097,6 +1097,7 @@ pub struct Workspace {
|
||||||
serialized_ssh_project: Option<SerializedSshProject>,
|
serialized_ssh_project: Option<SerializedSshProject>,
|
||||||
_items_serializer: Task<Result<()>>,
|
_items_serializer: Task<Result<()>>,
|
||||||
session_id: Option<String>,
|
session_id: Option<String>,
|
||||||
|
scheduled_tasks: Vec<Task<()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EventEmitter<Event> for Workspace {}
|
impl EventEmitter<Event> for Workspace {}
|
||||||
|
@ -1428,6 +1429,7 @@ impl Workspace {
|
||||||
_items_serializer,
|
_items_serializer,
|
||||||
session_id: Some(session_id),
|
session_id: Some(session_id),
|
||||||
serialized_ssh_project: None,
|
serialized_ssh_project: None,
|
||||||
|
scheduled_tasks: Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue