Rework remote task synchronization (#18746)
Reworks the way tasks are stored, accessed and synchronized in the `project`. Now both collab and ssh remote projects use the same TaskStorage kind to get the task context from the remote host, and worktree task templates are synchronized along with other worktree settings. Release Notes: - Adds ssh support to tasks, improves collab-remote projects' tasks sync
This commit is contained in:
parent
f1053ff525
commit
49c75eb062
18 changed files with 1262 additions and 1366 deletions
|
@ -27,19 +27,17 @@ use anyhow::Context as _;
|
|||
use assets::Assets;
|
||||
use futures::{channel::mpsc, select_biased, StreamExt};
|
||||
use outline_panel::OutlinePanel;
|
||||
use project::TaskSourceKind;
|
||||
use project_panel::ProjectPanel;
|
||||
use quick_action_bar::QuickActionBar;
|
||||
use release_channel::{AppCommitSha, ReleaseChannel};
|
||||
use rope::Rope;
|
||||
use search::project_search::ProjectSearchBar;
|
||||
use settings::{
|
||||
initial_local_settings_content, initial_tasks_content, watch_config_file, KeymapFile, Settings,
|
||||
SettingsStore, DEFAULT_KEYMAP_PATH,
|
||||
initial_local_settings_content, initial_tasks_content, KeymapFile, Settings, SettingsStore,
|
||||
DEFAULT_KEYMAP_PATH,
|
||||
};
|
||||
use std::any::TypeId;
|
||||
use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};
|
||||
use task::static_source::{StaticSource, TrackedFile};
|
||||
use theme::ActiveTheme;
|
||||
use workspace::notifications::NotificationId;
|
||||
use workspace::CloseIntent;
|
||||
|
@ -229,27 +227,6 @@ pub fn initialize_workspace(
|
|||
.unwrap_or(true)
|
||||
});
|
||||
|
||||
let project = workspace.project().clone();
|
||||
if project.update(cx, |project, cx| {
|
||||
project.is_local() || project.is_via_ssh() || project.ssh_connection_string(cx).is_some()
|
||||
}) {
|
||||
project.update(cx, |project, cx| {
|
||||
let fs = app_state.fs.clone();
|
||||
project.task_inventory().update(cx, |inventory, cx| {
|
||||
let tasks_file_rx =
|
||||
watch_config_file(cx.background_executor(), fs, paths::tasks_file().clone());
|
||||
inventory.add_source(
|
||||
TaskSourceKind::AbsPath {
|
||||
id_base: "global_tasks".into(),
|
||||
abs_path: paths::tasks_file().clone(),
|
||||
},
|
||||
|tx, cx| StaticSource::new(TrackedFile::new(tasks_file_rx, tx, cx)),
|
||||
cx,
|
||||
);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
let prompt_builder = prompt_builder.clone();
|
||||
cx.spawn(|workspace_handle, mut cx| async move {
|
||||
let assistant_panel =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue