Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(testing): add Peek Error and the test results peek

rokartur6a5387138ea2
diff --git a/native/crates/app/src/theme/debug_colors.rs b/native/crates/app/src/theme/debug_colors.rs
index 1522a171d0e..2bae1ce4101 100644
--- a/native/crates/app/src/theme/debug_colors.rs
+++ b/native/crates/app/src/theme/debug_colors.rs
@@ -46,6 +46,11 @@ pub(super) fn debug_default(key: &str) -> Option<[ColorValue; 4]> {
"testing.iconPassed" | "testing.runAction" => [Hex("#73c991"), Hex("#73c991"), Hex("#73c991"), Hex("#007100")],
"testing.iconQueued" => [Key("list.warningForeground"), Key("list.warningForeground"), Key("list.warningForeground"), Key("list.warningForeground")],
"testing.iconUnset" | "testing.iconSkipped" => [Hex("#848484"), Hex("#848484"), Hex("#848484"), Hex("#848484")],
+ "testing.peekBorder" => [Key("editorError.foreground"), Key("editorError.foreground"), Key("contrastBorder"), Key("contrastBorder")],
+ "testing.peekHeaderBackground" => {
+ const HEADER: ColorValue = Transparent(&Key("editorError.foreground"), 0.1);
+ [HEADER, HEADER, ColorValue::None, ColorValue::None]
+ }
"testing.iconFailed.retired" => retired(&Key("testing.iconFailed")),
"testing.iconErrored.retired" => retired(&Key("testing.iconErrored")),
"testing.iconPassed.retired" => retired(&Key("testing.iconPassed")),
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index d690b4346a8..424b4641925 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -42,6 +42,7 @@ mod disassembly_view;
mod testing_continuous;
mod testing_filter;
mod testing_gutter;
+mod testing_peek;
mod testing_results;
mod testing_item_menu;
mod testing_profiles;
@@ -607,6 +608,7 @@ pub struct Workbench {
breakpoint_widget: Option<breakpoint_widget::BreakpointWidget>,
pub testing: testing_service::TestingService,
testing_view: testing_view::TestingView,
+ testing_peek: Option<testing_peek::TestingPeek>,
multi_diff_layout_logs: Vec<editor_view::multi_diff_editor_view::MultiDiffLayoutLog>,
multi_diff_sash: editor_view::multi_diff_editor_view::MultiDiffSash,
}
@@ -966,6 +968,7 @@ impl Workbench {
breakpoint_widget: None,
testing: Default::default(),
testing_view: testing_view::TestingView::new(cx),
+ testing_peek: None,
multi_diff_layout_logs: Vec::new(),
multi_diff_sash: Default::default(),
};
@@ -1123,6 +1126,7 @@ impl Workbench {
workbench.register_debug_console_commands();
workbench.register_breakpoint_widget_commands();
workbench.register_testing_commands();
+ workbench.register_testing_peek_commands();
// Keybindings resolve before the focused element sees the key, and with nothing focused too.
let entity = cx.entity().downgrade();
cx.intercept_keystrokes(move |event, window, cx| {
diff --git a/native/crates/app/src/workbench/editor_view.rs b/native/crates/app/src/workbench/editor_view.rs
index 685634305de..6627a939bc1 100644
--- a/native/crates/app/src/workbench/editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view.rs
@@ -1397,6 +1397,7 @@ impl Workbench {
.children(self.quick_diff_widget(editor, metrics, window, cx))
.children(self.references_peek_widget(editor, metrics.content_left(), metrics.char_width, window, cx))
.children(self.hierarchy_peek_widget(editor, metrics.content_left(), metrics.char_width, window, cx))
+ .children(self.testing_peek_widget(editor, metrics.content_left(), metrics.char_width, cx))
.child(
div().id("margin").absolute().top_0().bottom_0().left_0().w(px(metrics.content_left())).on_hover(cx.listener(|workbench, hovered: &bool, _, cx| {
let animate = !workbench.is_motion_reduced();
diff --git a/native/crates/app/src/workbench/keyboard.rs b/native/crates/app/src/workbench/keyboard.rs
index d32101a44e0..e3e3feafdf8 100644
--- a/native/crates/app/src/workbench/keyboard.rs
+++ b/native/crates/app/src/workbench/keyboard.rs
@@ -535,6 +535,7 @@ impl Workbench {
self.goto_symbol_context(&mut context);
self.references_peek_context(window, &mut context);
self.hierarchy_peek_context(editor, window, &mut context);
+ self.testing_peek_context(editor, &mut context);
self.debug_hover_context(window, &mut context);
context.insert("editorHoverVisible".into(), json!(self.content_hover_visible()));
context.insert("editorHoverFocused".into(), json!(self.content_hover_focused(window)));
diff --git a/native/crates/app/src/workbench/peek_view.rs b/native/crates/app/src/workbench/peek_view.rs
index a6fe51a4e95..39c2e518c38 100644
--- a/native/crates/app/src/workbench/peek_view.rs
+++ b/native/crates/app/src/workbench/peek_view.rs
@@ -12,11 +12,12 @@ pub(super) const ARROW_HEIGHT: f32 = 6.;
pub(super) const HEAD_HEIGHT: f32 = 22.;
pub(super) const UI_FONT: &str = ".SystemUIFont";
-/// The peeks that can be open: the references peek and the call or type hierarchy peek.
+/// The peeks that can be open: the references peek, the call or type hierarchy peek and the test results peek.
#[derive(Clone, Copy, PartialEq, Debug)]
pub(super) enum PeekKind {
References,
Hierarchy,
+ Testing,
}
/// zoneWidget.ts `_resizeSash` below the zone and the split view sash between preview and tree.
@@ -51,6 +52,7 @@ impl Workbench {
match kind {
PeekKind::References => self.references_peek_layout(),
PeekKind::Hierarchy => self.hierarchy_peek_layout(),
+ PeekKind::Testing => self.testing_peek.as_ref().map(|peek| &peek.layout),
}
}
@@ -58,6 +60,7 @@ impl Workbench {
match kind {
PeekKind::References => self.references_peek_layout_mut(),
PeekKind::Hierarchy => self.hierarchy_peek_layout_mut(),
+ PeekKind::Testing => self.testing_peek.as_mut().map(|peek| &mut peek.layout),
}
}
@@ -67,9 +70,14 @@ impl Workbench {
let layout: Value = self.profile_storage.lock().unwrap().get(storage.key).and_then(|raw| serde_json::from_str(raw).ok()).unwrap_or_default();
let ratio = layout["ratio"].as_f64().filter(|ratio| *ratio != 0.).unwrap_or(0.7) as f32;
let stored_height = layout[storage.height_key].as_f64().filter(|height| *height != 0.).unwrap_or(storage.default_height as f64) as f32;
+ self.open_peek_zone_lines(at, stored_height, ratio)
+ }
+
+ /// A zone of `height_in_lines` below `at`, capped by `_getMaximumHeightInLines`.
+ pub(super) fn open_peek_zone_lines(&mut self, at: Position, height_in_lines: f32, ratio: f32) -> PeekLayout {
let viewport = self.editors.viewport;
let editor = self.editors.active_mut().expect("a peek opens in the active editor");
- let height_in_lines = stored_height.min(12f32.max(viewport.height / viewport.line_height * 0.8));
+ let height_in_lines = height_in_lines.min(12f32.max(viewport.height / viewport.line_height * 0.8));
let zone_id = editor.add_view_zone(Some(at), height_in_lines * viewport.line_height);
PeekLayout { model_id: editor.model_id, zone_id, height_in_lines, ratio, sash_drag: None, hovered_sash: None, sash_hover: None }
}
@@ -119,7 +127,10 @@ impl Workbench {
let zone = editor.view_zone(layout.zone_id)?;
let top = editor.view_zone_top(layout.zone_id, viewport)? - editor.scroll.top;
let width = content_left + viewport.width - VERTICAL_SCROLLBAR_WIDTH;
- let frame = self.color("peekView.border");
+ let frame = match kind {
+ PeekKind::Testing => self.color("testing.peekBorder"),
+ _ => self.color("peekView.border"),
+ };
// zoneWidget.ts `show`: the arrow is not pretty at column 1 and moves to column 2.
let anchor = zone.anchor?;
let line = &editor.document().lines[anchor.line];
@@ -171,6 +182,7 @@ impl Workbench {
.id(match kind {
PeekKind::References => "references-peek",
PeekKind::Hierarchy => "hierarchy-peek",
+ PeekKind::Testing => "testing-peek",
})
.absolute()
.left_0()
diff --git a/native/crates/app/src/workbench/testing_gutter.rs b/native/crates/app/src/workbench/testing_gutter.rs
index 7d12b8ac83b..41133b94994 100644
--- a/native/crates/app/src/workbench/testing_gutter.rs
+++ b/native/crates/app/src/workbench/testing_gutter.rs
@@ -41,7 +41,7 @@ impl Workbench {
}
}
- /// `getTestContextMenuActions`, but Peek Error, as the port has no testingOutputPeek.ts.
+ /// `getTestContextMenuActions`.
fn test_context_menu_actions(&mut self, id: &str, window: &Window) -> Vec<MenuAction> {
let capabilities = self.test_capabilities(id);
let mut actions = Vec::new();
@@ -53,7 +53,11 @@ impl Workbench {
if capabilities & HAS_NON_DEFAULT_PROFILE != 0 {
actions.push(self.bound_action("Execute Using Profile...", "testing.runUsing", vec![json!(id)]));
}
- if self.testing.state_of(id) == Some(ResultState::Running) {
+ let state = self.testing.state_of(id);
+ if matches!(state, Some(ResultState::Failed | ResultState::Errored)) {
+ actions.push(self.bound_action("Peek Error", "vscode.peekTestError", vec![json!(id)]));
+ }
+ if state == Some(ResultState::Running) {
actions.push(self.bound_action("Cancel Test Run", "testing.cancelRun", Vec::new()));
}
actions.push(self.bound_action("Reveal in Test Explorer", "_revealTestInExplorer", vec![json!(id)]));
diff --git a/native/crates/app/src/workbench/testing_peek.rs b/native/crates/app/src/workbench/testing_peek.rs
new file mode 100644
index 00000000000..0a8e1484109
--- /dev/null
+++ b/native/crates/app/src/workbench/testing_peek.rs
@@ -0,0 +1,134 @@
+//! testingOutputPeek.ts: `vscode.peekTestError` and the `TestResultsPeek` it opens at a failed test's message,
+//! with the message as its body (`TestResultsViewContent` with the history split hidden, its default).
+
+use gpui::{AnyElement, Context, Window, div, prelude::*, px};
+use serde_json::{Value, json};
+
+use super::Workbench;
+use super::peek_view::{PeekKind, PeekLayout};
+use super::testing_results::{InspectSubject, message_text};
+use crate::commands::Outcome;
+use crate::editor::{OpenEditor, Position, VerticalReveal};
+use crate::testing::{ResultItem, ResultState, TestResult};
+
+/// testingOutputPeek.ts `_getMaximumHeightInLines`: "41 is experimentally determined to be the overhead of the peek
+/// view itself".
+const PEEK_OVERHEAD: f32 = 41.;
+/// The content's padding and line height (`results_content`).
+const CONTENT_PADDING: f32 = 16.;
+const CONTENT_LINE_HEIGHT: f32 = 18.;
+
+pub(super) struct TestingPeek {
+ pub(super) layout: PeekLayout,
+ subject: InspectSubject,
+}
+
+/// `getFailedCandidateMessage`: in a failed task, the last error message with a location (the test's own as the
+/// fallback), else the first other message.
+fn failed_candidate(item: &ResultItem) -> Option<(usize, usize, Value)> {
+ let fallback = (!item.item["uri"].is_null() && !item.item["range"].is_null()).then(|| json!({ "uri": item.item["uri"], "range": item.item["range"] }));
+ let mut best: Option<(usize, usize, Value)> = None;
+ for (task_index, task) in item.tasks.iter().enumerate() {
+ for (index, message) in task.messages.iter().enumerate() {
+ let Some(location) = Some(&message["location"]).filter(|location| !location.is_null()).cloned().or_else(|| fallback.clone()) else { continue };
+ if !matches!(task.state, ResultState::Failed | ResultState::Errored) || (best.is_some() && message["type"] != 0) {
+ continue;
+ }
+ best = Some((task_index, index, location));
+ }
+ }
+ best
+}
+
+impl Workbench {
+ pub(super) fn register_testing_peek_commands(&mut self) {
+ self.commands.register("vscode.peekTestError", |workbench, args, window, cx| {
+ let peeked = args.first().and_then(Value::as_str).is_some_and(|id| workbench.peek_test_error(id, window, cx));
+ Outcome::Ready(Ok(json!(peeked)))
+ });
+ self.commands.register("editor.closeTestPeek", |workbench, _, window, cx| {
+ workbench.close_testing_peek(window, cx);
+ Outcome::done()
+ });
+ }
+
+ /// testing.contribution.ts `vscode.peekTestError`: the newest result with the test, its own failure first, else
+ /// the first child's (`tryPeekFirstError`).
+ pub(super) fn peek_test_error(&mut self, id: &str, window: &mut Window, cx: &mut Context<Self>) -> bool {
+ let Some(result) = self.testing.results.iter().find(|result| result.items.contains_key(id)) else { return false };
+ let Some((test, (task, message, location))) = first_failure(result, id) else { return false };
+ let subject = InspectSubject::Message { result: result.id.clone(), task, test, message };
+ self.show_testing_peek(subject, &location, window, cx);
+ true
+ }
+
+ /// `showPeekFromUri` with `selectionRevealType: NearTopIfOutsideViewport`, then `TestResultsPeek.setModel`.
+ fn show_testing_peek(&mut self, subject: InspectSubject, location: &Value, window: &mut Window, cx: &mut Context<Self>) {
+ let Some(path) = location["uri"]["path"].as_str().map(std::path::PathBuf::from) else { return };
+ let range = &location["range"];
+ let at = |key: &str| range[key].as_u64().unwrap_or(1) as usize;
+ self.close_testing_peek(window, cx);
+ self.open_file(path.clone(), true, window, cx);
+ let range = crate::anything_quick_access::TextRange { start_line_number: at("startLineNumber"), start_column: at("startColumn"), end_line_number: at("endLineNumber"), end_column: at("endColumn") };
+ self.select_range_revealed(&path, range, VerticalReveal::NearTopIfOutsideViewport, cx);
+ if self.editors.active().is_none_or(|editor| editor.document().path != path) {
+ return;
+ }
+ // `_getMaximumHeightInLines` from the content height, at most half the visible lines.
+ let lines = self.subject_text(&subject).unwrap_or_default().lines().count() as f32;
+ let viewport = self.editors.viewport;
+ let height = ((lines * CONTENT_LINE_HEIGHT + CONTENT_PADDING + PEEK_OVERHEAD) / viewport.line_height + 1.).min((viewport.height / viewport.line_height).round() / 2.);
+ let layout = self.open_peek_zone_lines(Position::new(at("startLineNumber").saturating_sub(1), at("startColumn").saturating_sub(1)), height, 0.7);
+ self.testing_peek = Some(TestingPeek { layout, subject });
+ cx.notify();
+ }
+
+ pub(super) fn close_testing_peek(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ let Some(peek) = self.testing_peek.take() else { return };
+ self.close_peek_zone(&peek.layout, None);
+ window.focus(&self.editor_focus, cx);
+ cx.notify();
+ }
+
+ /// `testing.isPeekVisible` on the editor that has the peek.
+ pub(super) fn testing_peek_context(&self, editor: &OpenEditor, context: &mut std::collections::HashMap<String, Value>) {
+ if self.testing_peek.as_ref().is_some_and(|peek| peek.layout.model_id == editor.model_id) {
+ context.insert("testing.isPeekVisible".into(), json!(true));
+ }
+ }
+
+ /// `TestResultsPeek`: `showInPlace` titles it with the message's first line and the test's label; the error
+ /// colors of `applyTheme`; the head's `MenuId.TestPeekTitle` actions and the close action.
+ pub(super) fn testing_peek_widget(&self, editor: &OpenEditor, content_left: f32, char_width: f32, cx: &mut Context<Self>) -> Option<AnyElement> {
+ let (label, description, text) = self.testing_peek_message()?;
+ let title = self.peek_title_parts(div().id("testing-peek-title"), label, description, String::new());
+ let actions = vec![self.peek_action("close", "Close", "editor.closeTestPeek", cx).into_any_element()];
+ let head = self.peek_head(title, actions).bg(self.color("editor.background")).child(div().absolute().inset_0().bg(self.color("testing.peekHeaderBackground")));
+ let lines: Vec<_> = text.lines().map(|line| div().whitespace_nowrap().child(line.to_owned())).collect();
+ self.peek_zone(PeekKind::Testing, editor, content_left, char_width, head.relative(), |_, _, _| {
+ let content = div().id("testing-peek-content").size_full().overflow_y_scroll().p(px(CONTENT_PADDING / 2.)).font_family("Menlo").text_size(px(12.)).line_height(px(CONTENT_LINE_HEIGHT)).flex().flex_col().children(lines);
+ (content.into_any_element(), false)
+ }, cx)
+ }
+
+ /// The peek's title (the message's first line), its description (the test's label) and the message.
+ fn testing_peek_message(&self) -> Option<(String, String, String)> {
+ let InspectSubject::Message { result, task, test, message } = &self.testing_peek.as_ref()?.subject else { return None };
+ let item = self.testing.results.iter().find(|candidate| candidate.id == *result)?.items.get(test)?;
+ let text = super::debug_console::strip_ansi(message_text(&item.tasks[*task].messages[*message]));
+ let label = text.lines().next().unwrap_or_default().to_owned();
+ Some((label, crate::command_palette::strip_icons(item.label()).trim().to_owned(), text))
+ }
+}
+
+/// The test's own failure, else the first failed descendant's in tree order (`result.tests` below the test).
+fn first_failure(result: &TestResult, id: &str) -> Option<(String, (usize, usize, Value))> {
+ let item = &result.items[id];
+ if let Some(candidate) = failed_candidate(item) {
+ return Some((id.to_owned(), candidate));
+ }
+ item.children.iter().filter(|child| result.items.contains_key(*child)).find_map(|child| first_failure(result, child))
+}
+
+#[cfg(test)]
+mod tests;
diff --git a/native/crates/app/src/workbench/testing_peek/tests.rs b/native/crates/app/src/workbench/testing_peek/tests.rs
new file mode 100644
index 00000000000..264156f5d72
--- /dev/null
+++ b/native/crates/app/src/workbench/testing_peek/tests.rs
@@ -0,0 +1,62 @@
+use gpui::TestAppContext;
+use serde_json::{Value, json};
+
+use super::InspectSubject;
+use crate::commands::Outcome;
+use crate::testing::{ResultState, TestResult};
+use crate::workbench::Workbench;
+use crate::workbench::testing_gutter::tests::{titles, workbench_with_tests};
+
+const TESTS: &[(&str, &str, u32)] = &[("c\0f", "math", 0), ("c\0f\0a", "adds", 1), ("c\0f\0b", "$(beaker) subtracts", 3)];
+
+/// `adds` passed and `subtracts` failed with a message without a location.
+fn add_result(workbench: &mut Workbench) {
+ let item = |id: &str| workbench.testing.collection.items[id].item.clone();
+ let mut result = TestResult::new("r1".into(), json!({ "group": 2, "targets": [{ "testIds": ["c\0f"] }] }));
+ result.add_task(&json!({ "id": "t1", "name": "Task A", "ctrlId": "c", "running": false }));
+ for id in ["c\0f\0a", "c\0f\0b"] {
+ result.add_chain(&[item("c"), item("c\0f"), item(id)]);
+ }
+ result.update_state("c\0f\0a", "t1", ResultState::Passed, Some(1.));
+ result.update_state("c\0f\0b", "t1", ResultState::Failed, Some(1.));
+ result.append_message("c\0f\0b", "t1", json!({ "type": 1, "message": "log line", "location": null }));
+ result.append_message("c\0f\0b", "t1", json!({ "type": 0, "message": "expected 1\nbut got 2", "location": null }));
+ result.mark_complete(2);
+ workbench.testing.results = vec![result];
+}
+
+fn peek(workbench: &gpui::Entity<Workbench>, id: &str, cx: &mut gpui::VisualTestContext) -> Value {
+ let outcome = workbench.update_in(cx, |workbench, window, cx| workbench.execute_command("vscode.peekTestError", vec![json!(id)], window, cx));
+ let Outcome::Ready(Ok(peeked)) = outcome else { panic!("a ready value") };
+ peeked
+}
+
+/// testingDecorations.ts `testing.gutter.peekFailure` on a failed test only; `vscode.peekTestError` on the parent
+/// peeks the first failed child's error message at the test's range, titled by the message's first line and the
+/// test's label; Escape's `editor.closeTestPeek` closes it.
+#[gpui::test]
+fn peek_error_opens_the_failed_childs_message_at_the_test(cx: &mut TestAppContext) {
+ let (workbench, cx, _host) = workbench_with_tests("testing-peek", TESTS, cx);
+ let (failed, passed) = workbench.update_in(cx, |workbench, window, _| {
+ add_result(workbench);
+ (titles(&workbench.test_gutter_actions(3, window)), titles(&workbench.test_gutter_actions(1, window)))
+ });
+ assert!(failed.contains(&"Peek Error".to_owned()), "{failed:?}");
+ assert!(!passed.contains(&"Peek Error".to_owned()), "{passed:?}");
+
+ assert_eq!(peek(&workbench, "c\0f\0a", cx), json!(false));
+ assert_eq!(peek(&workbench, "c\0f", cx), json!(true));
+ cx.run_until_parked();
+ workbench.update_in(cx, |workbench, window, _| {
+ let peek = workbench.testing_peek.as_ref().expect("a peek");
+ assert_eq!(peek.subject, InspectSubject::Message { result: "r1".into(), task: 0, test: "c\0f\0b".into(), message: 1 });
+ let (label, description, _) = workbench.testing_peek_message().unwrap();
+ assert_eq!((label.as_str(), description.as_str()), ("expected 1", "subtracts"));
+ assert_eq!(workbench.editors.active().unwrap().selection().head.line, 2);
+ assert_eq!(workbench.key_context(window).get("testing.isPeekVisible"), Some(&json!(true)));
+ });
+
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("editor.closeTestPeek", Vec::new(), window, cx)));
+ cx.run_until_parked();
+ assert!(workbench.read_with(cx, |workbench, _| workbench.testing_peek.is_none()));
+}
diff --git a/native/crates/app/src/workbench/testing_results.rs b/native/crates/app/src/workbench/testing_results.rs
index eec00d5a26a..db13d6536d8 100644
--- a/native/crates/app/src/workbench/testing_results.rs
+++ b/native/crates/app/src/workbench/testing_results.rs
@@ -114,7 +114,7 @@ fn tests_in_order(result: &TestResult) -> Vec<&String> {
}
/// `renderTestMessageAsText` of an `ITestMessage.Serialized`: its string, or its markdown's source.
-fn message_text(message: &Value) -> &str {
+pub(super) fn message_text(message: &Value) -> &str {
message["message"].as_str().or(message["message"]["value"].as_str()).unwrap_or_default()
}
@@ -589,19 +589,20 @@ impl Workbench {
/// The subject's text: a message, a task's output or a test's output in a task, as plain lines; a message
/// with testResultsViewContent.ts `populateFloatingClick`'s button.
fn results_content(&self, window: &Window, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
- let mut content = div().id("test-results-output").flex_1().min_w_0().relative().overflow_y_scroll().p(px(8.)).font_family("Menlo").text_size(px(12.)).flex().flex_col();
- let text = match &self.testing_view.results_subject {
- Some(InspectSubject::Task { result, task }) => self.result_by_id(result).and_then(|result| result.tasks.get(*task)).map(|task| task.output.clone()),
- Some(InspectSubject::Output { result, task, test }) => self.result_by_id(result).and_then(|result| result.items.get(test)).map(|item| {
+ let content = div().id("test-results-output").flex_1().min_w_0().relative().overflow_y_scroll().p(px(8.)).font_family("Menlo").text_size(px(12.)).flex().flex_col();
+ let text = self.testing_view.results_subject.as_ref().and_then(|subject| self.subject_text(subject));
+ let lines = super::debug_console::strip_ansi(&text.unwrap_or_default()).lines().map(|line| div().whitespace_nowrap().child(line.to_owned())).collect::<Vec<_>>();
+ content.children(lines).children(self.results_floating_button(window, cx))
+ }
+
+ pub(super) fn subject_text(&self, subject: &InspectSubject) -> Option<String> {
+ match subject {
+ InspectSubject::Task { result, task } => self.result_by_id(result).and_then(|result| result.tasks.get(*task)).map(|task| task.output.clone()),
+ InspectSubject::Output { result, task, test } => self.result_by_id(result).and_then(|result| result.items.get(test)).map(|item| {
item.tasks[*task].messages.iter().filter(|message| !is_error_message(message)).map(message_text).collect::<String>()
}),
- Some(InspectSubject::Message { result, task, test, message }) => self.result_by_id(result).map(|result| message_text(&result.items[test].tasks[*task].messages[*message]).to_owned()),
- None => None,
- };
- for line in super::debug_console::strip_ansi(&text.unwrap_or_default()).lines() {
- content = content.child(div().whitespace_nowrap().child(line.to_owned()));
+ InspectSubject::Message { result, task, test, message } => self.result_by_id(result).map(|result| message_text(&result.items[test].tasks[*task].messages[*message]).to_owned()),
}
- content.children(self.results_floating_button(window, cx))
}
/// floatingMenu.ts `FloatingClickMenu` of `MenuId.TestMessageContent`: its first item as a button at the
diff --git a/port/ledger.md b/port/ledger.md
index cd394a595d3..805ee81dc95 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_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/testing | workbench contribution | M16 | ported | [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 peek_error_opens_the_failed_childs_message_at_the_test 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) |