Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(testing): port the run and debug group dropdowns of the Test Explorer title

rokartur05abcd8517be
diff --git a/native/crates/app/src/menus.rs b/native/crates/app/src/menus.rs
index 90ee26d5e30..fe8c0f5e544 100644
--- a/native/crates/app/src/menus.rs
+++ b/native/crates/app/src/menus.rs
@@ -129,6 +129,7 @@ pub enum MenuId {
TimelineItemContext,
/// `MenuId.TestItem`: a test row's inline actions and context menu in the Testing view.
TestItem,
+ TestProfilesContext,
/// `MenuId.DebugCallStackContext`: a Call Stack row's context menu.
DebugCallStackContext,
/// `MenuId.DebugVariablesContext`: a Variables row's context menu.
@@ -967,7 +968,7 @@ pub fn workbench_menus() -> Vec<MenuItem> {
/// menusExtensionPoint.ts `apiMenus`: the `contributes.menus` keys of the menus the port shows. `commandPalette`
/// is read by `command_palette::menu`.
-const API_MENUS: [(&str, MenuId); 58] = [
+const API_MENUS: [(&str, MenuId); 59] = [
("file/newFile", MenuId::NewFile),
("editor/context", MenuId::EditorContext),
("explorer/context", MenuId::ExplorerContext),
@@ -998,6 +999,7 @@ const API_MENUS: [(&str, MenuId); 58] = [
("timeline/title", MenuId::TimelineTitle),
("timeline/item/context", MenuId::TimelineItemContext),
("testing/item/context", MenuId::TestItem),
+ ("testing/profiles/context", MenuId::TestProfilesContext),
("debug/callstack/context", MenuId::DebugCallStackContext),
("debug/variables/context", MenuId::DebugVariablesContext),
("debug/watch/context", MenuId::DebugWatchContext),
diff --git a/native/crates/app/src/testing.rs b/native/crates/app/src/testing.rs
index 37f7bfcbf77..0d85f175763 100644
--- a/native/crates/app/src/testing.rs
+++ b/native/crates/app/src/testing.rs
@@ -253,6 +253,7 @@ pub struct Profile {
pub is_default: bool,
pub tag: Option<String>,
pub supports_continuous_run: bool,
+ pub has_configuration_handler: bool,
}
impl Profile {
@@ -265,6 +266,7 @@ impl Profile {
is_default: value["isDefault"] == true,
tag: value["tag"].as_str().map(str::to_owned),
supports_continuous_run: value["supportsContinuousRun"] == true,
+ has_configuration_handler: value["hasConfigurationHandler"] == true,
}
}
@@ -281,6 +283,9 @@ impl Profile {
if let Some(supports) = patch["supportsContinuousRun"].as_bool() {
self.supports_continuous_run = supports;
}
+ if let Some(configurable) = patch["hasConfigurationHandler"].as_bool() {
+ self.has_configuration_handler = configurable;
+ }
if patch.get("tag").is_some() {
self.tag = patch["tag"].as_str().map(str::to_owned);
}
diff --git a/native/crates/app/src/testing/tests.rs b/native/crates/app/src/testing/tests.rs
index b81785eee33..5fe8fd14c83 100644
--- a/native/crates/app/src/testing/tests.rs
+++ b/native/crates/app/src/testing/tests.rs
@@ -63,7 +63,7 @@ fn output_goes_to_the_task_and_marks_the_test() {
#[test]
fn default_profile_respects_tags() {
let test = TestItem { id: "c\0a".into(), expand: ExpandState::NotExpandable, item: json!({ "tags": ["c\0slow"] }) };
- let profile = |id, tag: Option<&str>, is_default| Profile { controller_id: "c".into(), profile_id: id, label: String::new(), group: GROUP_RUN, is_default, tag: tag.map(str::to_owned), supports_continuous_run: false };
+ let profile = |id, tag: Option<&str>, is_default| Profile { controller_id: "c".into(), profile_id: id, label: String::new(), group: GROUP_RUN, is_default, tag: tag.map(str::to_owned), supports_continuous_run: false, has_configuration_handler: false };
let profiles = [profile(1, Some("fast"), true), profile(2, Some("slow"), false), profile(3, None, false)];
assert_eq!(default_profile(&profiles, GROUP_RUN, &test).map(|profile| profile.profile_id), Some(2));
assert_eq!(default_profile(&profiles, GROUP_DEBUG, &test), None);
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index 778153d15dd..fd58594f9d3 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -41,6 +41,7 @@ mod disassembly_view;
mod testing_continuous;
mod testing_filter;
mod testing_item_menu;
+mod testing_profiles;
pub(crate) mod testing_service;
mod testing_view;
mod define_keybinding;
diff --git a/native/crates/app/src/workbench/testing_continuous.rs b/native/crates/app/src/workbench/testing_continuous.rs
index 4c1a07d441c..2219e0b4e78 100644
--- a/native/crates/app/src/workbench/testing_continuous.rs
+++ b/native/crates/app/src/workbench/testing_continuous.rs
@@ -374,7 +374,7 @@ mod tests {
use crate::workspace_trust::{Startup, WorkspaceTrust};
fn profile(controller: &str, profile_id: i64, label: &str, group: u64) -> Profile {
- Profile { controller_id: controller.into(), profile_id, label: label.into(), group, is_default: true, tag: None, supports_continuous_run: true }
+ Profile { controller_id: controller.into(), profile_id, label: label.into(), group, is_default: true, tag: None, supports_continuous_run: true, has_configuration_handler: false }
}
/// A trusted workbench with the profiles and a test `<controller>\0t` under each controller.
diff --git a/native/crates/app/src/workbench/testing_item_menu/tests.rs b/native/crates/app/src/workbench/testing_item_menu/tests.rs
index 181d828e513..7da1a6e829d 100644
--- a/native/crates/app/src/workbench/testing_item_menu/tests.rs
+++ b/native/crates/app/src/workbench/testing_item_menu/tests.rs
@@ -10,7 +10,7 @@ use crate::workbench::Workbench;
use crate::workspace_trust::{Startup, WorkspaceTrust};
fn profile(profile_id: i64, label: &str, group: u64, is_default: bool) -> Profile {
- Profile { controller_id: "c".into(), profile_id, label: label.into(), group, is_default, tag: None, supports_continuous_run: true }
+ Profile { controller_id: "c".into(), profile_id, label: label.into(), group, is_default, tag: None, supports_continuous_run: true, has_configuration_handler: false }
}
/// testingExplorerView.ts `onContextMenu` on a test with a uri under a controller with two run profiles and a
diff --git a/native/crates/app/src/workbench/testing_profiles.rs b/native/crates/app/src/workbench/testing_profiles.rs
new file mode 100644
index 00000000000..47923f2e414
--- /dev/null
+++ b/native/crates/app/src/workbench/testing_profiles.rs
@@ -0,0 +1,235 @@
+//! testingExplorerView.ts `getRunGroupDropdown`: the view title's run and debug dropdowns, with the profile pickers
+//! of testingConfigurationUi.ts and testProfileService.ts's default profiles the user picks.
+
+use gpui::{Bounds, Context, Pixels, Task, Window};
+use serde_json::{Map, Value, json};
+
+use super::Workbench;
+use crate::commands::Outcome;
+use crate::main_thread_quick_open::Owner;
+use crate::menus::{MenuAction, MenuId, menu_actions};
+use crate::quick_input::{Entry, Item, Kind, QuickInput};
+use crate::testing::{GROUP_COVERAGE, GROUP_DEBUG, GROUP_RUN, Profile};
+
+/// testProfileService.ts `userDefaults`: `{ [controllerId]: { [profileId]: isDefault } }` in the workspace.
+const DEFAULTS_KEY: &str = "testingPreferredProfiles2";
+
+/// testProfileService.ts `addProfile`: the user's stored choice wins over the extension's `isDefault`.
+pub(super) fn stored_profile_default(storage: &storage::Storage, profile: &Profile) -> Option<bool> {
+ let defaults: Value = serde_json::from_str(storage.get(DEFAULTS_KEY)?).ok()?;
+ defaults[&profile.controller_id][profile.profile_id.to_string()].as_bool()
+}
+
+/// `updateProfile`: an `isDefault` update is stored as if the user had picked it.
+pub(super) fn store_profile_default(storage: &mut storage::Storage, profile: &Profile) {
+ let mut defaults: Value = storage.get(DEFAULTS_KEY).and_then(|stored| serde_json::from_str(stored).ok()).unwrap_or_else(|| json!({}));
+ defaults[&profile.controller_id][profile.profile_id.to_string()] = json!(profile.is_default);
+ storage.set(DEFAULTS_KEY, defaults.to_string());
+}
+
+fn group_context(group: u64) -> Option<&'static str> {
+ match group {
+ GROUP_RUN => Some("run"),
+ GROUP_DEBUG => Some("debug"),
+ GROUP_COVERAGE => Some("coverage"),
+ _ => None,
+ }
+}
+
+impl super::testing_service::TestingService {
+ /// `all()`: the profiles of each controller in the order they were published, sorted as `sorter`: defaults
+ /// first, then by label.
+ fn profiles_by_controller(&self) -> Vec<Vec<Profile>> {
+ let mut controllers: Vec<Vec<Profile>> = Vec::new();
+ for profile in &self.profiles {
+ match controllers.iter_mut().find(|profiles| profiles[0].controller_id == profile.controller_id) {
+ Some(profiles) => profiles.push(profile.clone()),
+ None => controllers.push(vec![profile.clone()]),
+ }
+ }
+ for profiles in &mut controllers {
+ profiles.sort_by(|a, b| b.is_default.cmp(&a.is_default).then_with(|| crate::command_palette::locale_compare(&a.label, &b.label)));
+ }
+ controllers
+ }
+
+ /// `getGroupDefaultProfiles`: the group's default profiles, else its first one.
+ fn group_default_profiles(&self, group: u64) -> Vec<Profile> {
+ let all: Vec<Profile> = self.profiles_by_controller().into_iter().flatten().collect();
+ let defaults: Vec<Profile> = all.iter().filter(|profile| profile.group == group && profile.is_default).cloned().collect();
+ if !defaults.is_empty() {
+ return defaults;
+ }
+ all.into_iter().filter(|profile| profile.group == group).take(1).collect()
+ }
+
+ pub(super) fn group_profile_count(&self, group: u64) -> usize {
+ self.profiles.iter().filter(|profile| profile.group == group).count()
+ }
+
+ /// `setGroupDefaultProfiles`: the group's profiles in `chosen` become its defaults, and a controller's profile
+ /// of another group named as one of them follows it. Returns the defaults to store, replacing the stored ones.
+ fn set_group_default_profiles(&mut self, group: u64, chosen: &[i64]) -> Value {
+ for profile in self.profiles.iter_mut().filter(|profile| profile.group == group) {
+ profile.is_default = chosen.contains(&profile.profile_id);
+ }
+ let in_group: Vec<(String, String, bool)> = self.profiles.iter().filter(|profile| profile.group == group).map(|profile| (profile.controller_id.clone(), profile.label.clone(), profile.is_default)).collect();
+ let mut next = Map::new();
+ for profile in &mut self.profiles {
+ let entry = next.entry(profile.controller_id.clone()).or_insert_with(|| json!({}));
+ if profile.group != group {
+ let Some((.., is_default)) = in_group.iter().find(|(controller, label, _)| *controller == profile.controller_id && *label == profile.label) else { continue };
+ profile.is_default = *is_default;
+ }
+ entry[profile.profile_id.to_string()] = json!(profile.is_default);
+ }
+ Value::Object(next)
+ }
+}
+
+impl Workbench {
+ pub(super) fn register_testing_profile_commands(&mut self) {
+ // testExplorerActions.ts `SelectDefaultTestProfiles`.
+ self.commands.register("testing.selectDefaultTestProfiles", |workbench, args, window, cx| {
+ let group = args.first().and_then(Value::as_u64).unwrap_or(GROUP_RUN);
+ let selected = workbench.testing.group_default_profiles(group);
+ let picked = workbench.pick_test_profiles(Some(group), false, Some(&selected), None, window, cx);
+ cx.spawn_in(window, async move |this, cx| {
+ let Some(profiles) = picked.await.filter(|profiles| !profiles.is_empty()) else { return };
+ let chosen: Vec<i64> = profiles.iter().map(|profile| profile.profile_id).collect();
+ let _ = this.update_in(cx, |workbench, window, cx| workbench.set_group_default_profiles(group, &chosen, window, cx));
+ })
+ .detach();
+ Outcome::done()
+ });
+ // `ConfigureTestProfilesAction`: testProfileService.ts `configure` of the picked profile.
+ self.commands.register("testing.configureProfile", |workbench, args, window, cx| {
+ let group = args.first().and_then(Value::as_u64);
+ let picked = workbench.pick_test_profiles(group, true, None, Some("Select a profile to update"), window, cx);
+ cx.spawn_in(window, async move |this, cx| {
+ let Some(profile) = picked.await.and_then(|profiles| profiles.into_iter().next()) else { return };
+ let request = vec![json!(profile.controller_id), json!(profile.profile_id)];
+ let _ = this.update(cx, |workbench, _| workbench.host.send("ExtHostTesting", "$configureRunProfile", request));
+ })
+ .detach();
+ Outcome::done()
+ });
+ }
+
+ fn set_group_default_profiles(&mut self, group: u64, chosen: &[i64], window: &mut Window, cx: &mut Context<Self>) {
+ let defaults = self.testing.set_group_default_profiles(group, chosen);
+ self.workspace_storage.lock().unwrap().set(DEFAULTS_KEY, defaults.to_string());
+ self.send_default_profiles();
+ self.continuous_profiles_changed(window, cx);
+ cx.notify();
+ }
+
+ /// testingConfigurationUi.ts `buildPicker` for `vscode.pickTestProfile` (one profile) and, given `selected`,
+ /// `vscode.pickMultipleTestProfiles`: each controller's profiles by group under the group's name (none when
+ /// showing `only_group`), described by the controller's label.
+ fn pick_test_profiles(&mut self, only_group: Option<u64>, only_configurable: bool, selected: Option<&[Profile]>, placeholder: Option<&str>, window: &mut Window, cx: &mut Context<Self>) -> Task<Option<Vec<Profile>>> {
+ let mut entries = Vec::new();
+ let mut profiles = Vec::new();
+ for mut controller in self.testing.profiles_by_controller() {
+ let description = self.testing.controllers.get(&controller[0].controller_id).map(|controller| controller.label.clone());
+ controller.sort_by_key(|profile| profile.group);
+ let mut header = None;
+ for profile in &controller {
+ if only_group.is_some_and(|group| group != profile.group) || (only_configurable && !profile.has_configuration_handler) {
+ continue;
+ }
+ if only_group.is_none() && header != Some(profile.group) {
+ header = Some(profile.group);
+ entries.push(Entry::Separator(super::testing_continuous::group_name(profile.group).map(str::to_owned)));
+ }
+ let picked = selected.is_some_and(|selected| selected.iter().any(|chosen| chosen.controller_id == profile.controller_id && chosen.profile_id == profile.profile_id));
+ entries.push(Entry::Item(Item { handle: profiles.len() as i64, label: profile.label.clone(), description: description.clone(), picked, ..Item::default() }));
+ profiles.push(profile.clone());
+ }
+ }
+ let (sender, receiver) = futures::channel::oneshot::channel();
+ let mut input = QuickInput::new(0, Kind::QuickPick);
+ input.placeholder = Some(placeholder.unwrap_or("Pick a test profile to use").into());
+ input.can_select_many = selected.is_some();
+ input.set_items(entries);
+ input.select_picked_items();
+ let id = self.quick_inputs.add(input, Owner::Debug(Some(sender)));
+ self.show_quick_input(id, window, cx);
+ self.flush_quick_input_events(window, cx);
+ cx.spawn(async move |_, _| {
+ let handles = receiver.await.ok().flatten()?;
+ Some(handles.split(',').filter_map(|handle| profiles.get(handle.parse::<usize>().ok()?).cloned()).collect())
+ })
+ }
+
+ /// `getTestConfigGroupActions`: each controller's profiles of the group under its disabled label, then the
+ /// `testing/profiles/context` actions, then Select Default Profile and Configure Test Profiles.
+ pub(super) fn show_run_group_dropdown(&mut self, group: u64, anchor: Bounds<Pixels>, window: &mut Window, cx: &mut Context<Self>) {
+ let defaults = self.testing.group_default_profiles(group);
+ let mut profile_actions = Vec::new();
+ let mut participating = 0;
+ let mut has_configurable = false;
+ for controller in self.testing.profiles_by_controller() {
+ let in_group: Vec<Profile> = controller.into_iter().filter(|profile| profile.group == group).collect();
+ let Some(first) = in_group.first() else { continue };
+ let label = self.testing.controllers.get(&first.controller_id).map(|controller| controller.label.clone()).unwrap_or_default();
+ profile_actions.push(MenuAction::Command { id: String::new(), title: label.into(), enabled: false, checked: false, alt: None });
+ for profile in in_group {
+ has_configurable |= profile.has_configuration_handler;
+ participating += 1;
+ let is_default = defaults.iter().any(|default| default.controller_id == profile.controller_id && default.profile_id == profile.profile_id);
+ let title = if is_default { format!("{} (Default)", profile.label) } else { profile.label.clone() };
+ // The menu runs commands: one per profile stands in for the dropdown's plain actions.
+ let id = format!("_testing.runUsingProfile.{}.{}", profile.controller_id, profile.profile_id);
+ self.commands.unregister(&id);
+ self.commands.register(id.clone(), move |workbench, _, window, cx| {
+ workbench.run_tests_with_profile(&profile, window, cx);
+ Outcome::done()
+ });
+ profile_actions.push(MenuAction::Command { id, title: title.into(), enabled: true, checked: false, alt: None });
+ }
+ }
+ let mut context = self.key_context(window);
+ if let Some(name) = group_context(group) {
+ context.insert("testing.profile.context.group".into(), json!(name));
+ }
+ let menu = menu_actions(&self.menus, MenuId::TestProfilesContext, &context);
+ let mut post_actions = Vec::new();
+ if participating > 1 {
+ post_actions.push(self.group_command_action("testing.selectDefaultTestProfiles", "Select Default Profile", group));
+ }
+ if has_configurable {
+ post_actions.push(self.group_command_action("testing.configureProfile", "Configure Test Profiles", group));
+ }
+ let mut actions = Vec::new();
+ for part in [profile_actions, menu, post_actions] {
+ if part.is_empty() {
+ continue;
+ }
+ if !actions.is_empty() {
+ actions.push(MenuAction::Separator);
+ }
+ actions.extend(part);
+ }
+ self.show_context_menu_actions(actions, &context, anchor, Vec::new(), window, cx);
+ }
+
+ /// An action running `command` with the group as its argument.
+ fn group_command_action(&mut self, command: &'static str, title: &str, group: u64) -> MenuAction {
+ let id = format!("_{command}.{group}");
+ self.commands.unregister(&id);
+ self.commands.register(id.clone(), move |workbench, _, window, cx| workbench.execute_command(command, vec![json!(group)], window, cx));
+ MenuAction::Command { id, title: title.into(), enabled: true, checked: false, alt: None }
+ }
+
+ /// A dropdown profile's run: `getTreeIncludeExclude(profile)` over the roots the profile can run.
+ fn run_tests_with_profile(&mut self, profile: &Profile, window: &mut Window, cx: &mut Context<Self>) {
+ let roots: Vec<String> = self.testing.collection.roots.iter().filter(|root| **root == profile.controller_id).cloned().collect();
+ let (include, exclude) = self.testing_include_exclude(profile.group, Some(&roots));
+ let request = json!({ "exclude": exclude, "group": profile.group, "targets": [{ "profileId": profile.profile_id, "controllerId": profile.controller_id, "testIds": include }] });
+ self.run_resolved_tests(request, window, cx);
+ }
+}
+
+#[cfg(test)]
+mod tests;
diff --git a/native/crates/app/src/workbench/testing_profiles/tests.rs b/native/crates/app/src/workbench/testing_profiles/tests.rs
new file mode 100644
index 00000000000..f28617d31e8
--- /dev/null
+++ b/native/crates/app/src/workbench/testing_profiles/tests.rs
@@ -0,0 +1,127 @@
+use std::path::Path;
+use std::sync::{Arc, Mutex};
+
+use gpui::TestAppContext;
+use serde_json::json;
+
+use crate::menus::{MenuAction, MenuId, MenuItem};
+use crate::quick_input::Entry;
+use crate::testing::{GROUP_DEBUG, GROUP_RUN, Profile};
+use crate::workbench::Workbench;
+use crate::workbench::testing_service::Controller;
+use crate::workspace_trust::{Startup, WorkspaceTrust};
+
+fn profile(profile_id: i64, label: &str, group: u64, is_default: bool, has_configuration_handler: bool) -> Profile {
+ Profile { controller_id: "c".into(), profile_id, label: label.into(), group, is_default, tag: None, supports_continuous_run: false, has_configuration_handler }
+}
+
+/// A trusted workbench with controller "c" (labeled "Ctrl"), its root and one test, and the profiles.
+fn workbench_with(profiles: Vec<Profile>, cx: &mut TestAppContext) -> (gpui::Entity<Workbench>, &mut gpui::VisualTestContext, std::sync::mpsc::Receiver<crate::host_sync::HostMessage>) {
+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let theme = crate::theme::load_theme(&[exthost::scan::scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap()], "Dark Modern").unwrap();
+ let (sender, host) = std::sync::mpsc::channel();
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), crate::default_settings(), crate::host_sync::HostSync::new(sender), cx);
+ let mut storage = storage::Storage::in_memory();
+ let startup = Startup { enabled: false, workspace: None, empty_window_trusted: false, workspace_storage: &mut storage };
+ workbench.workspace_trust = WorkspaceTrust::new(Arc::new(Mutex::new(storage::Storage::in_memory())), startup);
+ workbench.testing.controllers.insert("c".into(), Controller { label: "Ctrl".into(), capabilities: 0 });
+ workbench.testing.collection.apply(&[json!({ "op": 0, "item": { "expand": 0, "item": { "extId": "c", "label": "c", "tags": [] } } }), json!({ "op": 0, "item": { "expand": 0, "item": { "extId": "c\0t", "label": "t", "tags": [] } } })]);
+ workbench.testing.profiles = profiles;
+ workbench
+ });
+ (workbench, cx, host)
+}
+
+/// The view title's actions with a run group dropdown stay inside the side bar's title.
+#[gpui::test]
+fn the_run_group_chevron_keeps_the_view_title_actions_in_the_side_bar(cx: &mut TestAppContext) {
+ let (workbench, cx, _host) = workbench_with(vec![profile(1, "Fast", GROUP_RUN, true, false), profile(2, "Slow", GROUP_RUN, false, false)], cx);
+ workbench.update_in(cx, |workbench, window, cx| {
+ workbench.set_part_hidden(crate::workbench::layout::Part::SideBar, false, cx);
+ drop(workbench.execute_command("workbench.view.testing", Vec::new(), window, cx));
+ });
+ cx.run_until_parked();
+ cx.update(|window, _| window.refresh());
+ cx.run_until_parked();
+ let title = cx.debug_bounds("side-bar-title-label").expect("the side bar title draws");
+ let side_bar_right = cx.debug_bounds("testing-tree").expect("the tree draws").right();
+ for selector in ["codicon-run-all", "codicon-chevron-down", "codicon-debug-alt-small", "codicon-collapse-all"] {
+ let bounds = cx.debug_bounds(selector).unwrap_or_else(|| panic!("{selector} draws"));
+ assert!(bounds.origin.y < title.bottom() && bounds.right() < side_bar_right, "{selector} at {bounds:?}, title {title:?}");
+ }
+}
+
+/// testingExplorerView.ts `getTestConfigGroupActions` for the run group of a controller with two run profiles,
+/// one configurable, and a `testing/profiles/context` contribution for the run group only.
+#[gpui::test]
+fn the_run_group_dropdown_lists_its_profiles_and_runs_the_picked_one(cx: &mut TestAppContext) {
+ let profiles = vec![profile(2, "Slow", GROUP_RUN, false, true), profile(1, "Fast", GROUP_RUN, true, false), profile(3, "Debug", GROUP_DEBUG, true, false)];
+ let (workbench, cx, host) = workbench_with(profiles, cx);
+ let contributed = |group: &str| MenuItem { menu: MenuId::TestProfilesContext, entry: crate::menus::Entry::Command { id: format!("ext.{group}"), precondition: None, toggled: None, alt: None }, title: format!("Ext {group}"), group: String::new(), order: 0., when: crate::contextkey::Expr::deserialize(&format!("testing.profile.context.group == {group}")) };
+ workbench.update(cx, |workbench, _| workbench.menus.extend([contributed("run"), contributed("debug")]));
+
+ let actions = workbench.update_in(cx, |workbench, window, cx| {
+ workbench.show_run_group_dropdown(GROUP_RUN, gpui::Bounds::default(), window, cx);
+ workbench.context_menu.as_ref().expect("the dropdown shows").levels[0].actions.clone()
+ });
+ let titles: Vec<(String, bool)> = actions.iter().map(|action| match action {
+ MenuAction::Command { title, enabled, .. } => (title.to_string(), *enabled),
+ _ => ("---".into(), true),
+ }).collect();
+ let item = |title: &str, enabled: bool| (title.to_owned(), enabled);
+ assert_eq!(titles, [item("Ctrl", false), item("Fast (Default)", true), item("Slow", true), item("---", true), item("Ext run", true), item("---", true), item("Select Default Profile", true), item("Configure Test Profiles", true)]);
+
+ let MenuAction::Command { id, .. } = &actions[2] else { unreachable!() };
+ let id = id.clone();
+ workbench.update_in(cx, |workbench, window, cx| {
+ workbench.hide_context_menu(window, cx);
+ drop(workbench.execute_command(&id, Vec::new(), window, cx));
+ });
+ cx.run_until_parked();
+ let runs: Vec<_> = host.try_iter().filter(|message| message.method == "$runControllerTests").map(|message| message.args[0][0].clone()).collect();
+ assert_eq!(runs.iter().map(|run| (run["profileId"].clone(), run["testIds"].clone())).collect::<Vec<_>>(), [(json!(2), json!(["c"]))]);
+}
+
+/// testExplorerActions.ts `SelectDefaultTestProfiles`: the group's profiles with its defaults picked; the accepted
+/// ones become the defaults, a same-named profile of another group follows, and the choice is stored and outlives
+/// the extension publishing the profile again (testProfileService.ts `addProfile`).
+#[gpui::test]
+fn select_default_profile_stores_the_picked_defaults(cx: &mut TestAppContext) {
+ let profiles = vec![profile(1, "Fast", GROUP_RUN, true, false), profile(2, "Slow", GROUP_RUN, false, false), profile(3, "Slow", GROUP_DEBUG, false, false)];
+ let (workbench, cx, host) = workbench_with(profiles, cx);
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("testing.selectDefaultTestProfiles", vec![json!(GROUP_RUN)], window, cx)));
+ cx.run_until_parked();
+ let shown = workbench.update_in(cx, |workbench, window, cx| {
+ let input = workbench.quick_inputs.current().expect("the picker shows");
+ let shown: Vec<(String, Option<String>, bool)> = input.items().iter().map(|entry| match entry {
+ Entry::Item(item) => (item.label.clone(), item.description.clone(), input.selected_handles().contains(&item.handle)),
+ other => (format!("{other:?}"), None, false),
+ }).collect();
+ let id = input.id;
+ let input = workbench.quick_inputs.get_mut(id).unwrap();
+ input.set_selected_items(&[1]);
+ input.accept_from_ui();
+ workbench.flush_quick_input_events(window, cx);
+ shown
+ });
+ cx.run_until_parked();
+ let item = |label: &str, picked: bool| (label.to_owned(), Some("Ctrl".to_owned()), picked);
+ assert_eq!(shown, [item("Fast", true), item("Slow", false)], "one group shows without a header");
+
+ let defaults = workbench.read_with(cx, |workbench, _| workbench.testing.profiles.iter().map(|profile| (profile.profile_id, profile.is_default)).collect::<Vec<_>>());
+ assert_eq!(defaults, [(1, false), (2, true), (3, true)]);
+ let stored = workbench.read_with(cx, |workbench, _| workbench.workspace_storage.lock().unwrap().get("testingPreferredProfiles2").map(str::to_owned));
+ assert_eq!(stored.map(|stored| serde_json::from_str::<serde_json::Value>(&stored).unwrap()), Some(json!({ "c": { "1": false, "2": true, "3": true } })));
+ let sent: Vec<_> = host.try_iter().filter(|message| message.method == "$setDefaultRunProfiles").map(|message| message.args[0].clone()).collect();
+ assert_eq!(sent.last(), Some(&json!({ "c": [2, 3] })));
+
+ workbench.update_in(cx, |workbench, window, cx| {
+ workbench.testing.profiles.clear();
+ let published = json!({ "controllerId": "c", "profileId": 1, "label": "Fast", "group": GROUP_RUN, "isDefault": true });
+ let request = exthost::session::ForwardedRequest { req: 1, proxy: "MainThreadTesting", method: "$publishTestRunProfile".into(), args: vec![published] };
+ drop(workbench.handle_testing_request(request, window, cx));
+ });
+ let republished = workbench.read_with(cx, |workbench, _| workbench.testing.profiles.iter().map(|profile| (profile.profile_id, profile.is_default)).collect::<Vec<_>>());
+ assert_eq!(republished, [(1, false)]);
+}
diff --git a/native/crates/app/src/workbench/testing_service.rs b/native/crates/app/src/workbench/testing_service.rs
index 033fb3eee61..17d346121ea 100644
--- a/native/crates/app/src/workbench/testing_service.rs
+++ b/native/crates/app/src/workbench/testing_service.rs
@@ -109,7 +109,10 @@ impl Workbench {
}
}
"$publishTestRunProfile" => {
- let profile = Profile::from_value(&arg(0));
+ let mut profile = Profile::from_value(&arg(0));
+ if let Some(is_default) = super::testing_profiles::stored_profile_default(&self.workspace_storage.lock().unwrap(), &profile) {
+ profile.is_default = is_default;
+ }
if testing.controllers.contains_key(&profile.controller_id) {
testing.profiles.retain(|existing| (existing.controller_id.as_str(), existing.profile_id) != (profile.controller_id.as_str(), profile.profile_id));
testing.profiles.push(profile);
@@ -120,6 +123,9 @@ impl Workbench {
let (controller, id) = (text(0), arg(1).as_i64());
if let Some(profile) = testing.profiles.iter_mut().find(|profile| profile.controller_id == controller && Some(profile.profile_id) == id) {
profile.update(&arg(2));
+ if arg(2)["isDefault"].is_boolean() {
+ super::testing_profiles::store_profile_default(&mut self.workspace_storage.lock().unwrap(), profile);
+ }
}
self.send_default_profiles();
}
@@ -208,7 +214,7 @@ impl Workbench {
}
/// mainThreadTesting.ts `onDidChange` of the profiles: `$setDefaultRunProfiles`.
- fn send_default_profiles(&self) {
+ pub(super) fn send_default_profiles(&self) {
let mut defaults: HashMap<String, Vec<i64>> = HashMap::new();
for group in [GROUP_RUN, GROUP_DEBUG, GROUP_COVERAGE] {
for profile in self.testing.profiles.iter().filter(|profile| profile.group & group != 0 && profile.is_default) {
diff --git a/native/crates/app/src/workbench/testing_view.rs b/native/crates/app/src/workbench/testing_view.rs
index 214ea481bcc..81859269252 100644
--- a/native/crates/app/src/workbench/testing_view.rs
+++ b/native/crates/app/src/workbench/testing_view.rs
@@ -31,6 +31,9 @@ pub struct TestingView {
pub selected_test: Option<String>,
/// Where the continuous run dropdown's chevron last painted, to anchor its menu.
pub continuous_dropdown_bounds: std::rc::Rc<std::cell::Cell<gpui::Bounds<gpui::Pixels>>>,
+ /// Where the run and the debug group dropdowns' chevrons last painted.
+ pub run_dropdown_bounds: std::rc::Rc<std::cell::Cell<gpui::Bounds<gpui::Pixels>>>,
+ pub debug_dropdown_bounds: std::rc::Rc<std::cell::Cell<gpui::Bounds<gpui::Pixels>>>,
pub filter: TestingFilter,
}
@@ -42,6 +45,8 @@ impl TestingView {
selected_result: None,
selected_test: None,
continuous_dropdown_bounds: Default::default(),
+ run_dropdown_bounds: Default::default(),
+ debug_dropdown_bounds: Default::default(),
filter: TestingFilter::new(cx),
}
}
@@ -95,6 +100,7 @@ impl Workbench {
Outcome::done()
});
self.register_testing_continuous_commands();
+ self.register_testing_profile_commands();
self.register_test_item_commands();
self.register_testing_filter_commands();
self.commands.register("workbench.view.extension.test", |workbench, args, window, cx| workbench.execute_command("workbench.view.testing", args, window, cx));
@@ -250,12 +256,26 @@ impl Workbench {
let has_tests = !self.testing.collection.roots.is_empty();
let mut actions = div().flex().gap(px(2.)).mr(px(4.));
if has_tests {
- actions = actions.child(self.search_action("refresh", "testing.refreshTests", self.testing.controllers.values().any(|controller| controller.capabilities & 2 != 0), cx));
+ // testExplorerActions.ts `RefreshTestsAction` shows `when: canRefreshTests`.
+ if self.testing.controllers.values().any(|controller| controller.capabilities & 2 != 0) {
+ actions = actions.child(self.search_action("refresh", "testing.refreshTests", true, cx));
+ }
+ // `getRunGroupDropdown`: a chevron beside Run Tests and Debug Tests once their group has two profiles.
+ let run_dropdown = self.testing.group_profile_count(GROUP_RUN) > 1;
+ let debug_dropdown = self.testing.group_profile_count(GROUP_DEBUG) > 1;
actions = actions.child(match running {
true => self.search_action("debug-stop", "testing.cancelRun", true, cx),
false => self.search_action("run-all", "testing.runSelected", true, cx),
});
+ if !running && run_dropdown {
+ let bounds = self.testing_view.run_dropdown_bounds.clone();
+ actions = actions.child(self.dropdown_chevron("testing-run-dropdown", bounds, |workbench, anchor, window, cx| workbench.show_run_group_dropdown(GROUP_RUN, anchor, window, cx), cx));
+ }
actions = actions.child(self.search_action("debug-alt-small", "testing.debugSelected", !running, cx));
+ if debug_dropdown {
+ let bounds = self.testing_view.debug_dropdown_bounds.clone();
+ actions = actions.child(self.dropdown_chevron("testing-debug-dropdown", bounds, |workbench, anchor, window, cx| workbench.show_run_group_dropdown(GROUP_DEBUG, anchor, window, cx), cx));
+ }
// testExplorerActions.ts `continuousMenus`, ordered `RunUsing`.
if self.testing.profiles.iter().any(|profile| profile.supports_continuous_run) {
actions = actions.child(match self.testing.is_continuous_for("") {
@@ -263,7 +283,8 @@ impl Workbench {
false => self.search_action("eye", "testing.startContinuousRun", true, cx),
});
if self.testing.continuous_dropdown_profiles().len() > 1 {
- actions = actions.child(self.continuous_run_chevron(cx));
+ let bounds = self.testing_view.continuous_dropdown_bounds.clone();
+ actions = actions.child(self.dropdown_chevron("testing-continuous-run-dropdown", bounds, |workbench, anchor, window, cx| workbench.show_continuous_run_dropdown(anchor, window, cx), cx));
}
}
actions = actions.child(self.search_action("collapse-all", "testing.collapseAll", true, cx));
@@ -396,23 +417,27 @@ impl Workbench {
menu_group_actions(&self.test_item_menus(), MenuId::TestItem, &self.test_item_context(id, window), |group| group == "inline")
}
- /// dropdownWithPrimaryActionViewItem.ts's chevron beside the continuous run action, overlapping it by 3px.
- fn continuous_run_chevron(&self, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
+ /// dropdownWithPrimaryActionViewItem.ts's chevron beside its primary action, overlapping it by 3px; a press
+ /// shows `show` anchored at the chevron.
+ fn dropdown_chevron(&self, id: &'static str, bounds: std::rc::Rc<std::cell::Cell<gpui::Bounds<gpui::Pixels>>>, show: fn(&mut Self, gpui::Bounds<gpui::Pixels>, &mut Window, &mut Context<Self>), cx: &mut Context<Self>) -> Div {
let hover = self.color("toolbar.hoverBackground");
- let bounds = self.testing_view.continuous_dropdown_bounds.clone();
- self.icon("chevron-down", 16., 12., self.foreground_or("icon.foreground"))
+ let chevron = self
+ .icon("chevron-down", 16., 12., self.foreground_or("icon.foreground"))
.h(px(22.))
- .ml(px(-3.))
- .id("testing-continuous-run-dropdown")
- .relative()
+ .id(id)
+ .absolute()
+ .left(px(-3.))
.rounded(px(4.))
.cursor_pointer()
.hover(|action| action.bg(hover))
.child(super::output_view::bounds_tracker(bounds.clone()))
.on_mouse_down(MouseButton::Left, cx.listener(move |workbench, _: &MouseDownEvent, window, cx| {
cx.stop_propagation();
- workbench.show_continuous_run_dropdown(bounds.get(), window, cx);
- }))
+ show(workbench, bounds.get(), window, cx);
+ }));
+ // dropdown.css `margin-left: -3px` as a 13px slot: Taffy sizes a `flex: none` row without the negative margin,
+ // which pushed the view title's actions out of the side bar.
+ div().relative().flex_none().w(px(13.)).h(px(22.)).child(chevron)
}
/// testExplorerActions.ts `ContinuousRunTestAction`, the row's last action: shown without hover while the test
diff --git a/port/ledger.md b/port/ledger.md
index 454c9f5ec85..7620f87c00e 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -546,7 +546,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/telemetry | workbench contribution | M19 | verified | | the contribution logs to the NullTelemetryService and registers Show Telemetry only when supportsTelemetry, false in the built product: nothing to port; port/tools/telemetry-source-check no endpoint in 18370 shipped files (SELF_TEST finds 9 in the inert packages) |
| workbench/contrib/terminal | workbench contribution | M15 | verified | | workbench/terminal_view.rs: the Terminal panel view, terminals, split, kill, rename, profiles (`newWithProfile` with `profileName`: cargo test -p app new_with_profile), tabs list, the `TerminalInstanceContext` menu; no exit alert after a Ctrl+D exit (cargo test -p app a_ctrl_d_exit_shows_no_exit_alert); gutter command decorations with their menu (workbench/terminal_decorations.rs), scroll to previous/next command (terminal/marks.rs; cargo test -p app terminal::marks); ui-pair against the reference. Copy as HTML and Copy Output as HTML (terminal/serialize_html.rs; cargo test -p app serialize_html); the decoration hover with duration and exit code (cargo test -p app terminal_decorations, hover); Record Terminal Session (cargo test -p app a_recording_keeps_each_kind_of_event); overview ruler marks, Toggle Visibility (cargo test -p app toggle_visibility_writes_the_decorations_setting), the Rerun Command trust prompt, `terminal.integrated.cwd` variables (cargo test -p app the_cwd_setting_resolves_its_variables); ui-pair of OSC 99, decorations, overview ruler, Copy as HTML and Record Terminal Session (port/results/terminal.md); tab description `terminal.integrated.tabs.description` with `${cwdFolder}` (terminal/label.rs, TerminalLabelComputer and labels.ts `template`), the single tab "fish - docs": cargo test -p app terminal::label; ui-pair m12/folder-terminal.json matches but the reference's panel overflow "..." (its Ports view, remote is out of scope). The grid below `padding-block` 8px with columns from the rendered cell, the title toolbar at the reference's x and its "..." menu (cargo test -p app terminal_view::tests), Run Selected Text and Run Active File with paths quoted as `preparePathForShell` (cargo test -p app paths_are_quoted, call_operator); ui-pair m11/task-presentation.json for `reveal: silent` and `close` (port/results/manage-menu.md). Tab list rows: 4px inset, 8px padding (modernUI tabs.css), `┌ ` prefix, icon, name and description at the reference's device pixels (cargo test -p app a_tab_row_is_inset_and_its_label_is_one_line_of_text; ui-pair terminal tabs). Persistent sessions: panel groups with their splits and active panes, and terminal editors, revive with their history after a restart (cargo test -p app panel_terminals_revive_in_their_groups_after_a_restart a_terminal_editor_revives_with_its_history_after_a_restart) |
| workbench/contrib/terminalContrib | workbench contribution | M15 | verified | | links (terminal/link_parsing.rs, link_computer.rs, workbench/terminal_links.rs: Cmd+click URLs and paths with line:column), sendSequence, sendSignal, zoom (font size commands, Cmd+wheel), autoReplies (terminal/auto_replies.rs), find (terminal/search.rs and workbench/terminal_find.rs: case, whole word, regex, count, previous/next, match highlights), prompt input model (terminal/prompt_input.rs), suggest (workbench/terminal_suggest.rs), history (terminal/history.rs, workbench/terminal_history.rs: Run Recent Command, Go to Recent Directory, pinned items, shell history files), quick access (`term `, workbench/terminal_quick_access.rs), sticky scroll (terminal/sticky_scroll.rs, workbench/terminal_sticky_scroll.rs); cargo test -p app link_, terminal::search, prompt_input, auto_replies, terminal_contrib, terminal_links, terminal::history, sticky_scroll, quick_access; ui-pair of Run Recent Command, `term ` and sticky scroll; resize overlay (workbench/terminal_resize_overlay.rs), environment changes (Show Environment Contributions, workbench/terminal_environment.rs; cargo test -p app environment_collection), developer Write Data to Terminal (Show Terminal Texture Atlas and Restart Pty Host have no counterpart: GPUI draws without an atlas page and there is no pty host), command guide (cargo test -p app terminal::marks), notification (OSC 99, terminal/osc99.rs, workbench/terminal_notifications.rs; cargo test -p app osc99), quick fix (terminal/quick_fix.rs, workbench/terminal_quick_fix.rs: builtin fixes, extension providers, light bulb, Cmd+. widget, decoration menu; cargo test -p app quick_fix), accessibility (terminal/accessible_buffer.rs, the terminal provider of workbench/accessible_view.rs; cargo test -p app accessible), links in wrapped lines with the hover and underline (cargo test -p app terminal_links). inlineHint without AI: the initial hint "Show suggestions ⌃Space" with its dismiss links (workbench/terminal_initial_hint.rs; ui-pair against the reference); its Copilot CLI part, chat and voice are AI (removed), wslRecommendation is Windows (port/notes.md milestone 15) |
-| workbench/contrib/testing | workbench contribution | M16 | ported | [3 L] testing_view.rs `test_glyph`: no gutter context menu (testingDecorations.ts `getTestContextMenuActions`: Run, Debug, Run with Coverage, Execute Using Profile..., Peek Error, Cancel Test Run, Reveal in Test Explorer, per-test submenus on a multi-test line, then `MenuId.TestItemGutter`), so `testing/item/gutter` has no menu<br>[3 M] testing_view.rs view title: no run and debug group dropdown (testingExplorerView.ts `getRunGroupDropdown` with `MenuId.TestProfilesContext` and Select Default Profile), so `testing/profiles/context` has no menu<br>[3 L] testing_view.rs `test_results_body`: the results list is not testResultsTree.ts (no message rows, no context menus with `MenuId.TestPeekElement` and `MenuId.TestMessageContext`) and the message view lacks testResultsViewContent.ts's `FloatingClickMenu` of `MenuId.TestMessageContent`, so `testing/item/result`, `testing/message/context` and `testing/message/content` have no menu | `getTreeIncludeExclude` for the view title's Run Tests and Debug Tests (`ExecuteSelectedAction`) and a row's `RunVisibleAction`: the tests the filter box hides are excluded (cargo test -p app runs_from_the_explorer_exclude_the_tests_the_filter_hides); The explorer's filter box (testingExplorerFilter.ts and testExplorerFilterState.ts: text with history, terms, tags, globs, fuzzy; cargo test -p app testing_filter); testExclusions.ts: Hide Test, Unhide Test, Unhide All Tests, `@hidden`, `excludedTestItems` in workspace storage, runs exclude hidden tests (cargo test -p app a_hidden_test_leaves_the_tree_and_runs_until_it_is_unhidden); A test row's actions are `MenuId.TestItem`'s `inline` group with the testing icons (testingExplorerView.ts `fillActionBar`: cargo test -p app a_test_row_shows_the_test_item_menu_s_inline_group); A test row's context menu (testingExplorerView.ts `onContextMenu`: `MenuId.TestItem` but `inline`, the `getActionableElementActions` keys, the row as `TestItemContext`; cargo test -p app a_test_rows_context_menu_shows_and_runs_the_test_item_actions); `TreeSorter` by location with `compareFileNames` (cargo test -p app children_sort_by_line_then_by_file_name_order). The view title's continuous run dropdown when several profiles of controllers with tests support it (testingExplorerView.ts `getContinuousRunDropdown`: group labels, checked profiles, `stopProfile` cancels only that profile; cargo test -p app the_view_title_dropdown_starts_and_stops_one_profile_of_several); `testing.continuousRunUsingForTest` picks from the test's controller's profiles (cargo test -p app continuous_run_using_picks_from_the_tests_controller_only); testingContinuousRunService.ts: Turn on Continuous Run of a test and Start Continuous Run each hold one cancellable `$startContinuousRun` per profile until stopped, the eye activity badge, `testing.isContinuousModeOn`, the last run's profiles in workspace storage (cargo test -p app a_continuous_run_holds_one_cancellable_request_per_profile_until_it_stops). The Testing item's activity badge: the spinner during a run, else the newest result's `testing.countBadge` count (cargo test -p app the_testing_item_spins). ui-pair port/fixtures/debug-node with tests-provider: Testing view tree, Run All, pass/fail icons, Test Results tree and output, run glyphs in the gutter; cargo test -p app testing::; testServiceImpl.ts `runResolvedTests` asks for workspace trust after the live result is created, a refusal completes it (cargo test -p app a_test_run_waits_for_workspace_trust_and_completes_when_it_is_refused) |
+| workbench/contrib/testing | workbench contribution | M16 | ported | [3 L] testing_view.rs `test_glyph`: no gutter context menu (testingDecorations.ts `getTestContextMenuActions`: Run, Debug, Run with Coverage, Execute Using Profile..., Peek Error, Cancel Test Run, Reveal in Test Explorer, per-test submenus on a multi-test line, then `MenuId.TestItemGutter`), so `testing/item/gutter` has no menu<br>[3 S] testing_view.rs `dropdown_chevron`: the primary action and chevron take no `toolbar.activeBackground` while their dropdown is open (style.css `.monaco-dropdown.active .action-label`)<br>[3 M] testing_view.rs `testing_view_pane`: the view title is not testExplorerActions.ts's: no Show Output (`ShowMostRecentOutputAction`, `navigation`), Collapse All drawn in the title where upstream puts it in the `...` menu (`displayAction`), no `...` menu; opening the view does not focus the filter box, the "No test results yet." line is missing and file roots start expanded (ui-pair with port/fixtures/debug-node)<br>[3 M] testing_continuous.rs `testing_continuous_context`: the workbench context has only `testing.isContinuousModeOn` of testingContextKeys.ts; `testing.providerCount`, `testing.hasConfigurableProfile`, `testing.canRefreshTests`, `testing.hasAnyResults` and the rest are unset, so the Command Palette hides the `testing.providerCount > 0` commands such as Testing: Focus on Test Explorer View<br>[3 L] testing_view.rs `test_results_body`: the results list is not testResultsTree.ts (no message rows, no context menus with `MenuId.TestPeekElement` and `MenuId.TestMessageContext`) and the message view lacks testResultsViewContent.ts's `FloatingClickMenu` of `MenuId.TestMessageContent`, so `testing/item/result`, `testing/message/context` and `testing/message/content` have no menu | The view title's run and debug group dropdowns once a group has two profiles (testingExplorerView.ts `getRunGroupDropdown`, `getTestConfigGroupActions`: controller labels, `(Default)`, `MenuId.TestProfilesContext` by `testing.profile.context.group`, Select Default Profile, Configure Test Profiles; a profile runs the controller's roots; cargo test -p app the_run_group_dropdown_lists_its_profiles_and_runs_the_picked_one), Select Default Profile stores the defaults in `testingPreferredProfiles2` and they outlive a republish (testProfileService.ts; cargo test -p app select_default_profile_stores_the_picked_defaults), the chevron keeps the title's actions in the side bar and Refresh Tests shows only `when: canRefreshTests` (cargo test -p app the_run_group_chevron_keeps_the_view_title_actions_in_the_side_bar); ui-pair with a two-run-profile tests-provider: the open dropdown matches the reference; `getTreeIncludeExclude` for the view title's Run Tests and Debug Tests (`ExecuteSelectedAction`) and a row's `RunVisibleAction`: the tests the filter box hides are excluded (cargo test -p app runs_from_the_explorer_exclude_the_tests_the_filter_hides); The explorer's filter box (testingExplorerFilter.ts and testExplorerFilterState.ts: text with history, terms, tags, globs, fuzzy; cargo test -p app testing_filter); testExclusions.ts: Hide Test, Unhide Test, Unhide All Tests, `@hidden`, `excludedTestItems` in workspace storage, runs exclude hidden tests (cargo test -p app a_hidden_test_leaves_the_tree_and_runs_until_it_is_unhidden); A test row's actions are `MenuId.TestItem`'s `inline` group with the testing icons (testingExplorerView.ts `fillActionBar`: cargo test -p app a_test_row_shows_the_test_item_menu_s_inline_group); A test row's context menu (testingExplorerView.ts `onContextMenu`: `MenuId.TestItem` but `inline`, the `getActionableElementActions` keys, the row as `TestItemContext`; cargo test -p app a_test_rows_context_menu_shows_and_runs_the_test_item_actions); `TreeSorter` by location with `compareFileNames` (cargo test -p app children_sort_by_line_then_by_file_name_order). The view title's continuous run dropdown when several profiles of controllers with tests support it (testingExplorerView.ts `getContinuousRunDropdown`: group labels, checked profiles, `stopProfile` cancels only that profile; cargo test -p app the_view_title_dropdown_starts_and_stops_one_profile_of_several); `testing.continuousRunUsingForTest` picks from the test's controller's profiles (cargo test -p app continuous_run_using_picks_from_the_tests_controller_only); testingContinuousRunService.ts: Turn on Continuous Run of a test and Start Continuous Run each hold one cancellable `$startContinuousRun` per profile until stopped, the eye activity badge, `testing.isContinuousModeOn`, the last run's profiles in workspace storage (cargo test -p app a_continuous_run_holds_one_cancellable_request_per_profile_until_it_stops). The Testing item's activity badge: the spinner during a run, else the newest result's `testing.countBadge` count (cargo test -p app the_testing_item_spins). ui-pair port/fixtures/debug-node with tests-provider: Testing view tree, Run All, pass/fail icons, Test Results tree and output, run glyphs in the gutter; cargo test -p app testing::; testServiceImpl.ts `runResolvedTests` asks for workspace trust after the live result is created, a refusal completes it (cargo test -p app a_test_run_waits_for_workspace_trust_and_completes_when_it_is_refused) |
| workbench/contrib/themes | workbench contribution | M9 | verified | | Color Theme picker (`workbench.action.selectTheme`, Cmd+K Cmd+T): rows, order and descriptions as the reference, 200ms preview, Escape restores, accept writes `workbench.colorTheme`; File Icon Theme picker (`workbench.action.selectIconTheme`, Themes submenu): None and the installed themes, preview, Escape restores, accept writes `workbench.iconTheme` (null for None) (cargo test -p app themes); Product Icon Theme picker (`workbench.action.selectProductIconTheme`, Themes submenu): Default and the installed themes, writes `workbench.productIconTheme` (cargo test -p app product_icon; product-icons-pair `picker`: the same rows, except the reference's "Test Product Icon Theme" of vscode-colorize-tests, a test extension the port does not ship); no Marketplace browsing, no `window.autoDetectColorScheme` |
| workbench/contrib/timeline | workbench contribution | M14 | verified | | Timeline view (workbench/timeline_view.rs, timeline.rs): active editor and workspace timelines, paging, follow active editor, excluded sources in profile storage, compare selected, keyboard, `timeline/item/context` and title menus: cargo test -p app timeline; the title toolbar is a tab stop between the pane header and the tree (Shift+Tab focuses its first action with its hover, Left/Right, Enter): cargo test -p app shift_tab_reaches_the_title_toolbar; ui-pair m12/timeline.json header step matches; item labels draw their `$(icon)`s (cargo test -p app an_item_label_draws_its_icons); a `null` `timeline.pageSize` follows the view height (cargo test -p app a_null_page_size_follows_the_view_height) |
| workbench/contrib/typeHierarchy | workbench contribution | M13 | verified | | Peek Type Hierarchy in workbench/hierarchy_peek.rs: supertypes/subtypes toggle, layout `typeHierarchyPeekLayout`, the focused message of an empty answer, `_executePrepareTypeHierarchy`, `_executeProvideSupertypes`, `_executeProvideSubtypes`; cargo test -p app hierarchy; ui-pair port/results/language-features.md (Type hierarchy) |