Runnables: Add oneshot runnables (#8061)

/cc @SomeoneToIgnore 
Fixes #7460 and partially addresses #7108 
Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-02-20 23:13:09 +01:00 committed by GitHub
parent 8a73bc4c7d
commit 2ec910f772
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 163 additions and 17 deletions

View file

@ -23,6 +23,7 @@ use quick_action_bar::QuickActionBar;
use release_channel::{AppCommitSha, ReleaseChannel};
use rope::Rope;
use runnable::static_source::StaticSource;
use runnables_ui::OneshotSource;
use search::project_search::ProjectSearchBar;
use settings::{
initial_local_settings_content, watch_config_file, KeymapFile, Settings, SettingsStore,
@ -163,11 +164,14 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
app_state.fs.clone(),
paths::RUNNABLES.clone(),
);
let source = StaticSource::new(runnables_file_rx, cx);
let static_source = StaticSource::new(runnables_file_rx, cx);
let oneshot_source = OneshotSource::new(cx);
project.update(cx, |project, cx| {
project
.runnable_inventory()
.update(cx, |inventory, cx| inventory.add_source(source, cx))
project.runnable_inventory().update(cx, |inventory, cx| {
inventory.add_source(oneshot_source, cx);
inventory.add_source(static_source, cx);
})
});
}
cx.spawn(|workspace_handle, mut cx| async move {