Visual Studio Code, rebuilt in Rust
Rust
feat(testing): add Show Output and the ... menu to the Test Explorer title
rokarturfdf853620ce6
diff --git a/native/crates/app/src/testing.rs b/native/crates/app/src/testing.rsindex 0be62d66937..03d75b00078 100644--- a/native/crates/app/src/testing.rs+++ b/native/crates/app/src/testing.rs@@ -134,7 +134,7 @@ impl TestItem {/// testingExplorerView.ts `TreeSorter` by location: tests in one file with ranges by start line, then by sortText or/// label, except that two of them at one location without sortText keep the extension's order (#163449).-fn compare_tests(a: &TestItem, b: &TestItem) -> Ordering {+pub(crate) fn compare_tests(a: &TestItem, b: &TestItem) -> Ordering {let (uri_a, uri_b) = (&a.item["uri"], &b.item["uri"]);let in_same_location = !uri_a.is_null() && uri_a == uri_b && !a.item["range"].is_null() && !b.item["range"].is_null();if in_same_location && a.start_line() != b.start_line() {diff --git a/native/crates/app/src/workbench/testing_profiles/tests.rs b/native/crates/app/src/workbench/testing_profiles/tests.rsindex 81f7b447fda..ebb66a85501 100644--- a/native/crates/app/src/workbench/testing_profiles/tests.rs+++ b/native/crates/app/src/workbench/testing_profiles/tests.rs@@ -46,7 +46,7 @@ fn the_run_group_chevron_keeps_the_view_title_actions_in_the_side_bar(cx: &mut Tcx.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"] {+ for selector in ["codicon-run-all", "codicon-chevron-down", "codicon-debug-alt-small", "codicon-terminal", "codicon-ellipsis"] {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:?}");}diff --git a/native/crates/app/src/workbench/testing_view.rs b/native/crates/app/src/workbench/testing_view.rsindex cc114d63345..047f782f2de 100644--- a/native/crates/app/src/workbench/testing_view.rs+++ b/native/crates/app/src/workbench/testing_view.rs@@ -19,6 +19,11 @@ pub const TEST_RESULTS_VIEW_ID: &str = "workbench.panel.testResults";/// `Testing.ExplorerViewId`, the Test Explorer view in the Testing container.pub(super) const TESTING_VIEW: &str = "workbench.view.testing";const ROW_HEIGHT: f32 = 22.;+const VIEW_MODE_KEY: &str = "testing.viewMode";+const VIEW_SORTING_KEY: &str = "testing.viewSorting";+const SORT_BY_LOCATION: &str = "location";+const SORT_BY_STATUS: &str = "status";+const SORT_BY_DURATION: &str = "duration";/// The view state of the explorer and the results editor.pub struct TestingView {@@ -200,6 +205,19 @@ impl Workbench {cx.notify();Outcome::done()});+ for (id, key, value) in [+ ("testing.viewAsList", VIEW_MODE_KEY, "list"),+ ("testing.viewAsTree", VIEW_MODE_KEY, "true"),+ ("testing.sortByStatus", VIEW_SORTING_KEY, SORT_BY_STATUS),+ ("testing.sortByLocation", VIEW_SORTING_KEY, SORT_BY_LOCATION),+ ("testing.sortByDuration", VIEW_SORTING_KEY, SORT_BY_DURATION),+ ] {+ self.commands.register(id, move |workbench, _, _, cx| {+ workbench.workspace_storage.lock().unwrap().set(key, value.to_owned());+ cx.notify();+ Outcome::done()+ });+ }}/// The command's tests, else testExplorerActions.ts's "No tests found here" notification.@@ -323,7 +341,9 @@ impl Workbench {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));+ // `ShowMostRecentOutputAction`, navigation order `Collapse`, enabled by `testing.hasAnyResults`.+ actions = actions.child(self.search_action("terminal", "testing.showMostRecentOutput", !self.testing.results.is_empty(), cx));+ actions = actions.child(self.testing_more_actions(cx));}let mut body = div().id("testing-tree").debug_selector(|| "testing-tree".into()).flex_1().min_h_0().overflow_y_scroll().track_scroll(&self.testing_view.scroll).track_focus(&self.testing_view.tree_focus).flex().flex_col();if !has_tests {@@ -333,15 +353,122 @@ impl Workbench {} else {let mut rows = Vec::new();let visible = self.testing_filtered_tests().map(|(visible, _)| visible);- for id in self.testing_top_level() {+ for id in self.explorer_children(None) {self.test_rows(&id, 0, visible.as_ref(), &mut rows, window, cx);}self.reveal_selected_test_row(rows.iter().position(|(id, _)| self.testing_view.selected.as_ref() == Some(id)), rows.len(), window);body = body.children(rows.into_iter().map(|(_, row)| row));}let filter = has_tests.then(|| self.testing_filter_box(window, cx));- let body = div().flex_1().min_h_0().flex().flex_col().children(filter).child(body).into_any_element();- super::view_panes::ViewPane { id: TESTING_VIEW, title: "Test Explorer".into(), description: None, actions: has_tests.then(|| actions.into_any_element()), draws_more: false, show_actions: false, body }+ let summary = has_tests.then(|| self.result_summary()).flatten();+ let body = div().flex_1().min_h_0().flex().flex_col().children(filter).children(summary).child(body).into_any_element();+ super::view_panes::ViewPane { id: TESTING_VIEW, title: "Test Explorer".into(), description: None, actions: has_tests.then(|| actions.into_any_element()), draws_more: has_tests, show_actions: false, body }+ }++ /// testingExplorerView.ts `ResultSummaryView` while no result exists: "No test results yet." in its 27px+ /// container (testing.css `.result-summary-container`).+ fn result_summary(&self) -> Option<Div> {+ self.testing.results.is_empty().then(|| div().h(px(27.)).flex_none().px(px(12.)).pb(px(8.)).child("No test results yet."))+ }++ /// The view title's "...": the `viewAs`, `sortBy` and `displayAction` groups of testExplorerActions.ts.+ fn testing_more_actions(&self, cx: &mut Context<Self>) -> gpui::Stateful<Div> {+ let foreground = self.foreground_or("icon.foreground");+ self.icon("ellipsis", 22., 16., foreground)+ .id("testing-more")+ .rounded(px(4.))+ .cursor_pointer()+ .hover(|action| action.bg(self.color("toolbar.hoverBackground")))+ .on_mouse_down(MouseButton::Left, cx.listener(|workbench, event: &MouseDownEvent, window, cx| {+ cx.stop_propagation();+ workbench.show_testing_more_menu(event.position, window, cx);+ }))+ .on_click(cx.listener(|workbench, event: &ClickEvent, window, cx| {+ cx.stop_propagation();+ if event.is_keyboard() {+ workbench.show_testing_more_menu(event.position(), window, cx);+ }+ }))+ .child(self.hover_target("testing-more-hover", super::hover::HoverContent::Text("More Actions...".into()), super::hover::HoverOptions::action_item()))+ }++ pub(super) fn show_testing_more_menu(&mut self, position: gpui::Point<gpui::Pixels>, window: &mut Window, cx: &mut Context<Self>) {+ let actions = self.testing_more_menu_actions();+ let actions = self.view_secondary_actions(TESTING_VIEW, actions);+ let context = self.key_context(window);+ self.show_context_menu_actions(actions, &context, gpui::Bounds::new(position, Default::default()), Vec::new(), window, cx);+ }++ pub(super) fn testing_more_menu_actions(&self) -> Vec<MenuAction> {+ let list = self.testing_list_mode();+ let sorting = self.testing_sorting();+ let command = |id: &str, title: &str, checked: bool| MenuAction::Command { id: id.into(), title: title.into(), enabled: true, checked, alt: None };+ vec![+ command("testing.viewAsList", "View as List", list),+ command("testing.viewAsTree", "View as Tree", !list),+ MenuAction::Separator,+ command("testing.sortByStatus", "Sort by Status", sorting == SORT_BY_STATUS),+ command("testing.sortByLocation", "Sort by Location", sorting == SORT_BY_LOCATION),+ command("testing.sortByDuration", "Sort by Duration", sorting == SORT_BY_DURATION),+ MenuAction::Separator,+ command("testing.collapseAll", "Collapse All Tests", false),+ command("testing.clearTestResults", "Clear All Results", false),+ ]+ }++ /// constants.ts `TestExplorerViewMode`, stored as testingExplorerView.ts `testing.viewMode` (`list` or `true`).+ pub(super) fn testing_list_mode(&self) -> bool {+ self.workspace_storage.lock().unwrap().get(VIEW_MODE_KEY) == Some("list")+ }++ /// `TestExplorerViewSorting`, stored as `testing.viewSorting`, `location` by default.+ fn testing_sorting(&self) -> String {+ self.workspace_storage.lock().unwrap().get(VIEW_SORTING_KEY).unwrap_or(SORT_BY_LOCATION).to_owned()+ }++ /// The explorer's rows under `parent` (the top level for `None`, without the root of a single controller):+ /// treeProjection.ts or listProjection.ts, sorted by testingExplorerView.ts `TreeSorter`.+ pub(super) fn explorer_children(&self, parent: Option<&str>) -> Vec<String> {+ let collection = &self.testing.collection;+ let mut children = match (parent, self.testing_list_mode()) {+ (None, _) if collection.roots.len() > 1 => collection.roots.clone(),+ (None, false) => self.testing_top_level(),+ (Some(id), false) => collection.children_of(id).to_vec(),+ (None, true) => collection.roots.first().map(|root| self.test_leaves(root)).unwrap_or_default(),+ (Some(id), true) if crate::testing::parent_id(id).is_none() => self.test_leaves(id),+ (Some(_), true) => Vec::new(),+ };+ match self.testing_sorting().as_str() {+ SORT_BY_STATUS => children.sort_by_key(|id| std::cmp::Reverse(self.testing.state_of(id).unwrap_or_default().priority())),+ SORT_BY_DURATION => children.sort_by(|a, b| self.test_duration(b).unwrap_or(0.).total_cmp(&self.test_duration(a).unwrap_or(0.))),+ _ => {}+ }+ children+ }++ /// listProjection.ts: the tests under the root without children, in location order.+ fn test_leaves(&self, root: &str) -> Vec<String> {+ let collection = &self.testing.collection;+ let mut leaves = Vec::new();+ let mut stack: Vec<&String> = collection.children_of(root).iter().rev().collect();+ while let Some(id) = stack.pop() {+ match collection.children_of(id) {+ [] => leaves.push(id.clone()),+ children => stack.extend(children.iter().rev()),+ }+ }+ leaves.sort_by(|a, b| crate::testing::compare_tests(&collection.items[a], &collection.items[b]));+ leaves+ }++ /// getComputedState.ts `getComputedDuration`: the test's own duration, else the sum of its children's.+ fn test_duration(&self, id: &str) -> Option<f64> {+ let own = self.testing.results.iter().find(|result| result.items.contains_key(id)).and_then(|result| result.items[id].own_duration);+ if own.is_some() {+ return own;+ }+ let durations: Vec<f64> = self.testing.collection.children_of(id).iter().filter_map(|child| self.test_duration(child)).collect();+ (!durations.is_empty()).then(|| durations.iter().sum())}fn testing_button(&self, label: &str, command: &'static str, cx: &mut Context<Self>) -> gpui::Stateful<Div> {@@ -368,10 +495,14 @@ impl Workbench {return;}let Some(item) = self.testing.collection.items.get(id) else { return };- let children = self.testing.collection.children_of(id);- let expandable = item.expand != ExpandState::NotExpandable || !children.is_empty();- // index.ts: the top level starts expanded, deeper rows collapsed.- let expanded = expandable && !self.testing_view.collapsed.contains(id) && (depth == 0 || self.testing_view.expanded.contains(id));+ let list_mode = self.testing_list_mode();+ let children = self.explorer_children(Some(id));+ let is_root = crate::testing::parent_id(id).is_none();+ let expandable = match list_mode {+ true => is_root,+ false => item.expand != ExpandState::NotExpandable || !children.is_empty(),+ };+ let expanded = expandable && self.test_row_expanded(id);let state = self.testing.state_of(id).unwrap_or_default();let (icon, color) = state_icon(state);// icons.ts: `.computed-state.retired` takes the state's retired color; Running has none.@@ -420,8 +551,13 @@ impl Workbench {}).child(self.icon(icon, 22., 16., icon_color)).child(div().min_w_0().overflow_hidden().whitespace_nowrap().text_ellipsis().child(item.label().to_owned()));- if let Some(description) = item.item["description"].as_str() {- row = row.child(div().ml(px(6.)).text_size(px(12.)).opacity(0.7).whitespace_nowrap().child(description.to_owned()));+ // listProjection.ts `ListTestItemElement.description`: the labels between the root and the test.+ let description = match list_mode && !is_root {+ true => Some(self.test_ancestor_labels(id)).filter(|labels| !labels.is_empty()),+ false => item.item["description"].as_str().map(str::to_owned),+ };+ if let Some(description) = description {+ row = row.child(div().ml(px(6.)).text_size(px(12.)).opacity(0.7).whitespace_nowrap().child(description));}// testing.css `.test-is-hidden`: dimmed, with `testing-hidden` beside it unless the row is hovered.if self.testing.excluded.iter().any(|excluded| excluded == id) {@@ -460,12 +596,29 @@ impl Workbench {}));rows.push((id.to_owned(), row.into_any_element()));if expanded {- for child in children {+ for child in &children {self.test_rows(child, depth + 1, visible, rows, window, cx);}}}+ /// index.ts `getChildrenForParent`: a controller root starts expanded, deeper tests collapsed.+ pub(super) fn test_row_expanded(&self, id: &str) -> bool {+ !self.testing_view.collapsed.contains(id) && (crate::testing::parent_id(id).is_none() || self.testing_view.expanded.contains(id))+ }++ /// display.ts `flatTestItemDelimiter` between the labels of the test's ancestors below its root.+ pub(super) fn test_ancestor_labels(&self, id: &str) -> String {+ let mut labels = Vec::new();+ let mut parent = crate::testing::parent_id(id);+ while let Some(ancestor) = parent.filter(|ancestor| crate::testing::parent_id(ancestor).is_some()) {+ labels.push(self.testing.collection.items[ancestor].label());+ parent = crate::testing::parent_id(ancestor);+ }+ labels.reverse();+ labels.join(" \u{203a} ")+ }+/// testingExplorerView.ts `revealById`: `reveal(focusTarget, 0.5)` once the tree has painted with the row.fn reveal_selected_test_row(&self, index: Option<usize>, count: usize, window: &Window) {if !self.testing_view.reveal_pending.get() {@@ -630,3 +783,6 @@ impl Workbench {)}}++#[cfg(test)]+mod tests;diff --git a/native/crates/app/src/workbench/testing_view/tests.rs b/native/crates/app/src/workbench/testing_view/tests.rsnew file mode 100644index 00000000000..2e1a8db520d--- /dev/null+++ b/native/crates/app/src/workbench/testing_view/tests.rs@@ -0,0 +1,54 @@+use std::path::Path;++use gpui::{TestAppContext, VisualTestContext};+use serde_json::{Value, json};++use crate::menus::MenuAction;+use crate::workbench::Workbench;++fn add(id: &str, label: &str) -> Value {+ json!({ "op": 0, "item": { "expand": 0, "item": { "extId": id, "label": label, "tags": [], "uri": { "scheme": "file", "path": "/math.test.js" } } } })+}++fn workbench(cx: &mut TestAppContext) -> (gpui::Entity<Workbench>, &mut VisualTestContext) {+ 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();+ 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);+ workbench.testing.collection.apply(&[add("c", "c"), add("c\0math", "Math"), add("c\0math\0basic", "Basic"), add("c\0math\0basic\0add", "adds numbers"), add("c\0math\0basic\0sub", "subtracts"), add("c\0other", "Other")]);+ workbench+ })+}++fn checked(workbench: &Workbench) -> Vec<String> {+ let mut titles = Vec::new();+ for action in workbench.testing_more_menu_actions() {+ if let MenuAction::Command { title, checked: true, .. } = action {+ titles.push(title);+ }+ }+ titles+}++/// testExplorerActions.ts: View as List lists the root's leaves with their parents' labels (listProjection.ts), the+/// "..." checks the stored mode and sorting, and a file root below a single controller starts collapsed.+#[gpui::test]+fn view_as_list_shows_the_leaves_and_the_more_menu_checks_the_mode(cx: &mut TestAppContext) {+ let (workbench, cx) = workbench(cx);+ workbench.read_with(cx, |workbench, _| {+ assert_eq!(workbench.explorer_children(None), ["c\0math", "c\0other"]);+ assert!(!workbench.test_row_expanded("c\0math"), "a file root starts collapsed");+ assert!(workbench.test_row_expanded("c"));+ assert_eq!(checked(workbench), ["View as Tree", "Sort by Location"]);+ });+ workbench.update_in(cx, |workbench, window, cx| {+ drop(workbench.execute_command("testing.viewAsList", Vec::new(), window, cx));+ drop(workbench.execute_command("testing.sortByDuration", Vec::new(), window, cx));+ });+ workbench.read_with(cx, |workbench, _| {+ assert_eq!(workbench.explorer_children(None), ["c\0math\0basic\0add", "c\0other", "c\0math\0basic\0sub"]);+ assert_eq!(workbench.test_ancestor_labels("c\0math\0basic\0add"), "Math \u{203a} Basic");+ assert_eq!(checked(workbench), ["View as List", "Sort by Duration"]);+ });+}diff --git a/port/ledger.md b/port/ledger.mdindex ac229b81e81..280ea00ee45 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -601,7 +601,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, workbench/terminal_decorations.rs, terminal/marks.rs, terminal/serialize_html.rs, terminal/label.rs: cargo test -p app new_with_profile a_ctrl_d_exit_shows_no_exit_alert terminal::marks serialize_html terminal_decorations hover a_recording_keeps_each_kind_of_event toggle_visibility_writes_the_decorations_setting the_cwd_setting_resolves_its_variables terminal::label terminal_view::tests paths_are_quoted call_operator a_tab_row_is_inset_and_its_label_is_one_line_of_text panel_terminals_revive_in_their_groups_after_a_restart a_terminal_editor_revives_with_its_history_after_a_restart; ui-pair OSC 99, decorations, overview ruler, Copy as HTML, Record Terminal Session, terminal tabs (port/results/terminal.md), m12/folder-terminal.json (but the reference's Ports overflow, removed), m11/task-presentation.json (port/results/manage-menu.md) || workbench/contrib/terminalContrib | workbench contribution | M15 | verified | | terminal/link_parsing.rs, link_computer.rs, workbench/terminal_links.rs, terminal/auto_replies.rs, terminal/search.rs, workbench/terminal_find.rs, terminal/prompt_input.rs, workbench/terminal_suggest.rs, terminal/history.rs, workbench/terminal_quick_access.rs, terminal/sticky_scroll.rs, workbench/terminal_environment.rs, terminal/osc99.rs, terminal/quick_fix.rs, terminal/accessible_buffer.rs, workbench/terminal_initial_hint.rs: cargo test -p app link_ terminal::search prompt_input auto_replies terminal_contrib terminal_links terminal::history sticky_scroll quick_access environment_collection terminal::marks osc99 quick_fix accessible; ui-pair Run Recent Command, `term `, sticky scroll, the initial hint. No counterpart: Show Terminal Texture Atlas, Restart Pty Host. Removed: Copilot CLI, chat and voice (AI), wslRecommendation (Windows) (port/notes.md milestone 15) |-| workbench/contrib/testing | workbench contribution | M16 | ported | [3 M] testing_gutter.rs `test_context_menu_actions`: no Peek Error on a failed test, as testingOutputPeek.ts (`vscode.peekTestError`) is not ported<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; the "No test results yet." line is missing and file roots start expanded (ui-pair with port/fixtures/debug-node)<br>[3 M] testing_results.rs `results_tree`: not drawn as a workbench list: the opened row takes `list.inactiveSelectionBackground` where the reference shows the focused selection, a twistie on the task row where the reference has none, no indent guides, no keyboard navigation; content and tree split 1:1 with no sash where the reference opens about 2:1 (ui-pair port/fixtures/debug-node with tests-provider)<br>[3 M] testing_results.rs `results_content`: a message or output is plain text lines, not testResultsOutput.ts's diff, markdown, plain text and terminal peeks; no call stack (`MenuId.TestCallStack`), no `CoverageElement` rows | cargo test -p app testing:: testing_filter the_results_tree_shows_tasks_tests_and_messages_as_testresultstree a_results_rows_menu_shows_its_actions_and_the_contributed_items an_opened_message_shows_the_first_message_content_item the_gutter_menu_shows_the_tests_actions_before_the_line_number_items a_line_with_two_tests_shows_run_all_and_a_submenu_per_test reveal_in_test_explorer_expands_the_tests_parents the_run_group_dropdown_lists_its_profiles_and_runs_the_picked_one select_default_profile_stores_the_picked_defaults the_run_group_chevron_keeps_the_view_title_actions_in_the_side_bar runs_from_the_explorer_exclude_the_tests_the_filter_hides a_hidden_test_leaves_the_tree_and_runs_until_it_is_unhidden a_test_row_shows_the_test_item_menu_s_inline_group a_test_rows_context_menu_shows_and_runs_the_test_item_actions children_sort_by_line_then_by_file_name_order the_view_title_dropdown_starts_and_stops_one_profile_of_several continuous_run_using_picks_from_the_tests_controller_only a_continuous_run_holds_one_cancellable_request_per_profile_until_it_stops the_testing_item_spins a_test_run_waits_for_workspace_trust_and_completes_when_it_is_refused; ui-pair port/fixtures/debug-node with tests-provider (Testing tree, Run All, results tree, row menus, opened message, run glyphs and the gutter menu on port/fixtures/debug-node/math.test.js line 2, the run profile dropdown); cargo test -p app a_contributed_inline_result_action_draws_its_icon retired_tests_take_test_result_outdated a_line_with_more_than_30_tests_picks_the_rest_from_a_quick_pick reveal_in_test_explorer_selects_and_scrolls_to_the_row the_run_group_chevron_is_active_while_its_menu_is_open the_workbench_context_has_the_testing_service_keys |+| workbench/contrib/testing | workbench contribution | M16 | ported | [3 M] testing_gutter.rs `test_context_menu_actions`: no Peek Error on a failed test, as testingOutputPeek.ts (`vscode.peekTestError`) is not ported <br> [3 M] testing_results.rs `results_tree`: not drawn as a workbench list: the opened row takes `list.inactiveSelectionBackground` where the reference shows the focused selection, a twistie on the task row where the reference has none, no indent guides, no keyboard navigation; content and tree split 1:1 with no sash where the reference opens about 2:1 (ui-pair port/fixtures/debug-node with tests-provider) <br> [3 M] testing_results.rs `results_content`: a message or output is plain text lines, not testResultsOutput.ts's diff, markdown, plain text and terminal peeks; no call stack (`MenuId.TestCallStack`), no `CoverageElement` rows | cargo test -p app testing:: testing_filter the_results_tree_shows_tasks_tests_and_messages_as_testresultstree a_results_rows_menu_shows_its_actions_and_the_contributed_items an_opened_message_shows_the_first_message_content_item the_gutter_menu_shows_the_tests_actions_before_the_line_number_items a_line_with_two_tests_shows_run_all_and_a_submenu_per_test reveal_in_test_explorer_expands_the_tests_parents the_run_group_dropdown_lists_its_profiles_and_runs_the_picked_one select_default_profile_stores_the_picked_defaults the_run_group_chevron_keeps_the_view_title_actions_in_the_side_bar runs_from_the_explorer_exclude_the_tests_the_filter_hides a_hidden_test_leaves_the_tree_and_runs_until_it_is_unhidden a_test_row_shows_the_test_item_menu_s_inline_group a_test_rows_context_menu_shows_and_runs_the_test_item_actions children_sort_by_line_then_by_file_name_order the_view_title_dropdown_starts_and_stops_one_profile_of_several continuous_run_using_picks_from_the_tests_controller_only a_continuous_run_holds_one_cancellable_request_per_profile_until_it_stops the_testing_item_spins view_as_list_shows_the_leaves_and_the_more_menu_checks_the_mode a_test_run_waits_for_workspace_trust_and_completes_when_it_is_refused; ui-pair port/fixtures/debug-node with tests-provider (Testing tree, Run All, results tree, row menus, opened message, run glyphs and the gutter menu on port/fixtures/debug-node/math.test.js line 2, the run profile dropdown); cargo test -p app a_contributed_inline_result_action_draws_its_icon retired_tests_take_test_result_outdated a_line_with_more_than_30_tests_picks_the_rest_from_a_quick_pick reveal_in_test_explorer_selects_and_scrolls_to_the_row the_run_group_chevron_is_active_while_its_menu_is_open the_workbench_context_has_the_testing_service_keys || 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) |diff --git a/port/notes.md b/port/notes.mdindex 406a335d899..f5500240edc 100644--- a/port/notes.md+++ b/port/notes.md@@ -876,6 +876,7 @@ Scope as in the M19 Work row of port/ledger.md.- Protocol order: rpcProtocol.ts sends host methods whose last parameter is a `CancellationToken` as cancellable requests; `main_thread.rs` `TOKEN_METHODS` lists the debug and testing ones, without it js-debug and test run handlers got `undefined` tokens. An adapter's `initialized` event that arrives with the initialize response waits until the launch request is sent (js-debug rejects `setBreakpoints` before `launch`).- js-debug: `ms-vscode.js-debug` 1.140.1, `js-debug-companion` 1.1.3 and `vscode-js-profile-table` 1.0.11 (product.json `builtInExtensions`) are MIT and on Open VSX at those versions. Decision: ship them as upstream's dev build does, from `.build/builtInExtensions`, which `port/tools/fetch-builtin-extensions` fills from Open VSX; `exthost::scan::scan_dev_system_extensions` adds them to the built-ins. No marketplace or Microsoft service is contacted.- Testing (`testing.rs`, `workbench/testing_service.rs`, `testing_view.rs`): MainThreadTesting with the test collection diffs, run profiles, live results (`$runControllerTests`, `$startedExtensionTestRun`, `$applyTestRunUpdates`, `$publishTestResults`), the Testing view (shows once a controller registers), run glyphs in the editor gutter and the Test Results editor. VSBuffer arguments of forwarded requests now reach the workbench as byte arrays (`exthost::session::arg_value`).+- Test Explorer title (testExplorerActions.ts, `testing_view.rs`): the navigation actions end with Show Output (`terminal`, disabled until a result exists); the "..." holds View as List/Tree, Sort by Status/Location/Duration (workspace storage `testing.viewMode` and `testing.viewSorting`, as testingExplorerView.ts) and Collapse All Tests, Clear All Results. Shortcut: View as List lists the tests the collection has resolved; listProjection.ts also asks the controller to resolve every level (`expandElement(root, Infinity)`), which the port does not send.- Continuous run (`workbench/testing_continuous.rs`): the view title's dropdown of `getContinuousRunDropdown` runs plain actions upstream; the port's context menu runs commands, so each profile item is an internal `_testing.toggleContinuousRunProfile.<controller>.<profile>` command registered when the menu shows. testingExplorerView.ts re-sorts a parent when a continuous run changes, but `TreeSorter` has no continuous run criterion in 1.147.0, so the order does not change; the port draws rows from the run state each frame and needs no re-sort. The unattended restart participant `testing.continuousRun` waits on the unattended restart service (ledger row workbench/services/lifecycle).- Inline values (`workbench/debug_inline_values.rs`; debugEditorContribution.ts): `debug.inlineValues` `on` or `auto` with a provider shows the focused frame's values as `InjectionOwner::DebugInlineValue` text after the lines, `editor.inlineValuesForeground` on `editor.inlineValuesBackground`. Shortcuts: only the active editor shows them, where upstream decorates every editor on the frame's file; the scopes and variables are fetched again, not shared with the Variables view's cache; the text area width stands in for `layoutInfo.width` in the line length cut.- Debug hover (`workbench/debug_hover.rs`; debugHover.ts, debugEditorContribution.ts hover handling): while stopped, the expression at the mouse in the focused frame's file (the first `EvaluatableExpressionProvider` through `$provideEvaluatableExpression`, else `getExactExpressionStartAndEnd`) is evaluated with `context: "hover"` (or looked up in the cheap scopes without `supportsEvaluateForHovers`) after the doubled `editor.hover.delay`, the editor hover off meanwhile; Alt swaps it for the editor hover; Cmd+K Cmd+I shows it at the cursor. The focused tree takes listWidget.ts's and abstractTree.ts's keys through the `list.*` commands (Up, Down, Page Up, Page Down, Home, End, Left, Right, Space, Enter, type navigation by name), Escape clears a selection before it hides the widget; `layoutTree` sizes the tree to its rows plus 10px, at most max(266px, 55% of the editor) and the hovered line's top less 22px. The visualizers are a ledger gap of workbench/contrib/debug; the context menu is under Variable menus. The glyph margin lifts the editor hover lockout; the hovered position is the nearer edge of the character under the mouse, a tab's middle included. Lazy rows (`presentationHint.lazy`) draw the `$(eye)` button after the name in the hover, Variables and Watch trees; a lazy watch, hover or REPL result is evaluated at once (debugModel.ts `evaluateExpression` without `keepLazyVars`). A click on an expandable row focuses and toggles it; with Alt the descendants whose children are loaded follow, the others stay collapsed (indexTreeModel.ts `_setNodeCollapseState` recursive, asyncDataTree.ts collapsing a stale node a deep expand reaches). `list.find` (Cmd+Alt+F, F3) on the focused tree opens abstractTree.ts's find widget over 30px of padding: highlight or filter mode and fuzzy or contiguous match by `workbench.list.defaultFindMode` and `defaultFindMatchType` and the widget's toggles, the filter keeps a collapsed parent of a loaded match, "No results found.", the focus to the first match from the focused row; it outlives each shown value like the tree, and Escape hides the hover and runs `list.closeFind` after it. ui-pair on `port/fixtures/debug-node` (Cmd+K Cmd+I on `numbers` and `greeting`) matches the reference's placement, tree indent and focus outline.