Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(testing): show diffable result messages in an embedded diff

rokarture4ea9913a13b
diff --git a/native/crates/app/src/diff_editor.rs b/native/crates/app/src/diff_editor.rs
index a2bd750d107..eba5bfc636d 100644
--- a/native/crates/app/src/diff_editor.rs
+++ b/native/crates/app/src/diff_editor.rs
@@ -68,6 +68,8 @@ pub struct DiffInput {
pub synced_scroll: crate::editor::Scroll,
/// The custom editor showing the diff in place of the text diff editor (customEditors.ts `createDiffEditorInput`).
pub custom: Option<CustomDiff>,
+ /// A diff widget a view embeds with fixed options (testResultsOutput.ts `diffEditorOptions`), not a diff editor.
+ pub embedded: bool,
}
/// A custom editor's diff: its view type, and whether it is one `CustomEditorDiffInput` (inline) rather than a
@@ -87,7 +89,7 @@ pub struct ComputedDiff {
impl DiffInput {
pub fn new(original: Side, modified: Side, label: Option<String>) -> Self {
- DiffInput { original, modified, label, diff: None, inline_now: false, zones: Vec::new(), placed_zones: Vec::new(), unchanged: Vec::new(), unchanged_key: None, placed_unchanged: Vec::new(), unchanged_cursors: Vec::new(), unchanged_drag: None, symbols: Vec::new(), symbols_version: None, modified_editor: None, original_editor: None, original_focused: false, placed_original_zones: Vec::new(), placed_original_unchanged: Vec::new(), synced_scroll: crate::editor::Scroll::default(), custom: None }
+ DiffInput { original, modified, label, diff: None, inline_now: false, zones: Vec::new(), placed_zones: Vec::new(), unchanged: Vec::new(), unchanged_key: None, placed_unchanged: Vec::new(), unchanged_cursors: Vec::new(), unchanged_drag: None, symbols: Vec::new(), symbols_version: None, modified_editor: None, original_editor: None, original_focused: false, placed_original_zones: Vec::new(), placed_original_unchanged: Vec::new(), synced_scroll: crate::editor::Scroll::default(), custom: None, embedded: false }
}
/// `computeLabels` name: the preferred label, else `original ↔ modified`; customEditorDiffInput.ts `getName`
diff --git a/native/crates/app/src/editor.rs b/native/crates/app/src/editor.rs
index 0b2e4eaa850..dc55077eb3a 100644
--- a/native/crates/app/src/editor.rs
+++ b/native/crates/app/src/editor.rs
@@ -879,6 +879,7 @@ pub struct GroupState {
recent: Vec<u32>,
pub viewport: Viewport,
unicode_banner_closed: bool,
+ diff_part_width: Rc<Cell<f32>>,
}
impl GroupState {
@@ -955,6 +956,8 @@ pub struct EditorGroup {
next_model_id: u32,
/// The size of the group's one code editor, as last laid out; every editor of the group shows in it.
pub viewport: Viewport,
+ /// The width of the group's diff or multi diff editor, as last laid out.
+ pub diff_part_width: Rc<Cell<f32>>,
/// A line to center once the code editor has its first size: a diff opened before any editor showed (`revealFirstDiff`).
pub reveal_after_layout: Option<Position>,
/// unicodeHighlighter.ts `_bannerClosed`: the banner was closed for the model the code editor shows.
@@ -1411,7 +1414,7 @@ impl EditorGroup {
pub fn add_side_group(&mut self, entry: u32) -> u32 {
self.next_group_id += 1;
let id = self.next_group_id;
- self.other_groups.push(GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false });
+ self.other_groups.push(GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false, diff_part_width: Rc::default() });
self.side_by_sides.insert(entry, id);
id
}
@@ -1462,6 +1465,7 @@ impl EditorGroup {
std::mem::swap(&mut self.recent, &mut group.recent);
std::mem::swap(&mut self.viewport, &mut group.viewport);
std::mem::swap(&mut self.unicode_banner_closed, &mut group.unicode_banner_closed);
+ std::mem::swap(&mut self.diff_part_width, &mut group.diff_part_width);
self.other_groups.push(group);
self.group_mru.retain(|group| *group != id);
self.group_mru.insert(0, previous);
@@ -1483,7 +1487,7 @@ impl EditorGroup {
/// A group outside the grid (the panel's or the modal part's), made on first use.
pub fn ensure_detached_group(&mut self, id: u32) {
if self.id != id && self.group(id).is_none() {
- self.other_groups.push(GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false });
+ self.other_groups.push(GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false, diff_part_width: Rc::default() });
}
}
@@ -1492,7 +1496,7 @@ impl EditorGroup {
pub fn add_group(&mut self, copy_active: bool) -> u32 {
self.next_group_id += 1;
let id = self.next_group_id;
- let mut group = GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false };
+ let mut group = GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false, diff_part_width: Rc::default() };
if let Some(copy) = copy_active.then(|| self.copy_active()).flatten() {
let source = self.active_tab().expect("copied from the active tab").model_id;
self.copy_side_by_side(source, copy.model_id);
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index 444f3f23374..14d553537d9 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -413,8 +413,6 @@ pub struct Workbench {
fold_mouse_down: Option<(usize, bool)>,
/// Window x of the text area, recorded at paint, to turn a click into a column.
text_area_left: Rc<Cell<f32>>,
- /// The diff editor's width as last laid out, for the inline breakpoint.
- diff_part_width: Rc<Cell<f32>>,
/// The text area's window bounds at paint, where content widgets that may overflow it lay out.
text_area_bounds: Rc<Cell<gpui::Bounds<f32>>>,
editor_message: editor_message::EditorMessages,
@@ -822,7 +820,6 @@ impl Workbench {
find: find_widget::FindWidget::new(cx),
fold_mouse_down: None,
text_area_left: Rc::default(),
- diff_part_width: Rc::default(),
text_area_bounds: Rc::default(),
editor_message: Default::default(),
inspect_tokens: Default::default(),
diff --git a/native/crates/app/src/workbench/code_lens.rs b/native/crates/app/src/workbench/code_lens.rs
index 4ed282cc1be..05d192cb169 100644
--- a/native/crates/app/src/workbench/code_lens.rs
+++ b/native/crates/app/src/workbench/code_lens.rs
@@ -349,14 +349,14 @@ impl Workbench {
/// `_getLayoutInfo`: the lens font is `editor.codeLensFontSize`, or 90% of the editor's; the zone is that size
/// times the editor's line height factor, at least 1.3.
- fn code_lens_font_size(&self) -> f32 {
+ pub(super) fn code_lens_font_size(&self) -> f32 {
let editor = self.editors.active();
let size = editor.map(|editor| self.suggest_setting(editor, "editor.codeLensFontSize")).and_then(|size| size.as_f64()).unwrap_or(0.) as f32;
let font_size = EDITOR_FONT_SIZE * self.editor_zoom.multiplier();
if size < 5. { (font_size * 0.9).floor() } else { size }
}
- fn code_lens_height(&self) -> f32 {
+ pub(super) fn code_lens_height(&self) -> f32 {
let font_size = EDITOR_FONT_SIZE * self.editor_zoom.multiplier();
let factor = (self.editors.viewport.line_height / font_size).max(1.3);
(self.code_lens_font_size() * factor).floor()
diff --git a/native/crates/app/src/workbench/editor_view.rs b/native/crates/app/src/workbench/editor_view.rs
index febda981f8d..67b1c73c7f4 100644
--- a/native/crates/app/src/workbench/editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view.rs
@@ -1077,13 +1077,21 @@ impl Workbench {
if self.editors.multi_diff_side(editor.model_id).is_some() {
return self.multi_diff_editor_metrics(editor, window);
}
- let mut metrics = EditorMetrics::measure(window, editor.document().lines.len(), self.line_numbers(editor), self.editor_zoom.multiplier());
+ let test_data = editor.document().scheme == crate::testing::TEST_DATA_SCHEME;
+ // testResultsOutput.ts builds its editors outside a text editor part: the default lineNumbersMinChars 5.
+ let min_chars = if test_data { 5 } else { LINE_NUMBERS_MIN_CHARS };
+ let mut metrics = EditorMetrics::measure_with_min_chars(window, editor.document().lines.len(), self.line_numbers(editor), self.editor_zoom.multiplier(), min_chars);
// diffEditorEditors.ts `_adjustOptionsForSubEditor`: no folding and no minimap in either side.
if self.quick_diff_editor_diff(editor).is_some() {
// The quick diff peek's embedded diff editor keeps the default `lineDecorationsWidth` (10), not '2ch'.
metrics.decorations_width = self.diff_side_decorations_width(editor, DECORATIONS_WIDTH - 16.);
- } else if self.editors.active_diff().is_some() {
+ } else if let Some(diff) = self.editors.active_diff() {
metrics.decorations_width = self.diff_side_decorations_width(editor, diff_editor_view::diff_decorations_width(metrics.char_width));
+ // `_adjustOptionsForLeftHandSide` turns the glyph margin on; the modified side keeps
+ // testResultsOutput.ts `commonEditorOptions` glyphMargin false.
+ if test_data {
+ metrics.glyph_margin = diff.original_editor.as_ref().is_some_and(|original| original.model_id == editor.model_id);
+ }
} else if self.editors.active_merge().is_some() {
// mergeEditor.ts `applyOptions`: glyphMargin false and lineNumbersMinChars 2 in the inputs and the result.
metrics = EditorMetrics::measure_with_min_chars(window, editor.document().lines.len(), self.line_numbers(editor), self.editor_zoom.multiplier(), 2);
@@ -1093,7 +1101,7 @@ impl Workbench {
// editor also has no glyph margin (ui-pair steps-comment-reply-editor.json).
metrics.decorations_width = 0.;
metrics.glyph_margin = !is_comment_input(editor);
- } else if editor.document().scheme == crate::testing::TEST_DATA_SCHEME {
+ } else if test_data {
// testResultsOutput.ts `commonEditorOptions`: glyphMargin false.
metrics.glyph_margin = false;
} else if editor.document().scheme == crate::notebook::CELL_SCHEME {
@@ -1130,8 +1138,9 @@ impl Workbench {
match editor.line_numbers_override.or_else(|| setting.as_ref().and_then(|value| value.as_str())) {
// outputView.ts `OutputEditor.getConfigurationOverrides`: the Output view's editor hides line numbers.
_ if self.editors.id == crate::editor::PANEL_GROUP && editor.document().scheme == crate::output::OUTPUT_SCHEME => LineNumbers::Off,
- // testResultsOutput.ts `commonEditorOptions`: lineNumbers off in a result message's editor.
- _ if editor.document().scheme == crate::testing::TEST_DATA_SCHEME => LineNumbers::Off,
+ // testResultsOutput.ts `commonEditorOptions`: lineNumbers off in a result message's editor; a multiline
+ // diff's side editors override it.
+ _ if editor.document().scheme == crate::testing::TEST_DATA_SCHEME && editor.line_numbers_override.is_none() => LineNumbers::Off,
_ if self.zen_mode_hides_line_numbers() => LineNumbers::Off,
// simpleEditorOptions.ts: an interactive window's or REPL editor's input has none.
_ if self.is_interactive_input(editor) || is_comment_input(editor) => LineNumbers::Off,
diff --git a/native/crates/app/src/workbench/editor_view/diff_editor_view.rs b/native/crates/app/src/workbench/editor_view/diff_editor_view.rs
index 0b76c06e4db..4366c189f0d 100644
--- a/native/crates/app/src/workbench/editor_view/diff_editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view/diff_editor_view.rs
@@ -247,6 +247,16 @@ impl Workbench {
let mut quit_early = false;
for id in ids {
let mut input = self.editors.diffs.remove(&id).expect("listed above");
+ // An embedded diff of read-only models keeps the zones it placed while another group's editor is active.
+ if input.embedded && Some(id) != active {
+ self.editors.diffs.insert(id, input);
+ continue;
+ }
+ // testResultsOutput.ts `diffEditorOptions`: an embedded diff widget reads no `diffEditor.*` setting.
+ let (options, side_by_side, hide_unchanged) = match input.embedded {
+ true => (diff::DiffOptions { ignore_trim_whitespace: false, max_computation_time_ms: 5000, compute_moves: false, extend_to_subwords: false }, true, None),
+ false => (options, side_by_side, self.hide_unchanged_regions()),
+ };
let placed = std::mem::take(&mut input.placed_zones);
let placed_unchanged = std::mem::take(&mut input.placed_unchanged);
if let Some(modified) = self.editors.diff_modified_mut(&mut input.modified_editor, &input.modified) {
@@ -273,7 +283,7 @@ impl Workbench {
let updated = input.update(original, modified, options);
// diffEditorHelper.ts: a diff the algorithm stopped early is announced with each update.
quit_early |= updated && input.diff.as_ref().is_some_and(|computed| computed.diff.hit_timeout);
- input.update_unchanged(&original.text_model(), &modified.text_model(), self.hide_unchanged_regions());
+ input.update_unchanged(&original.text_model(), &modified.text_model(), hide_unchanged);
input.inline_now = !side_by_side;
let computed = input.diff.as_ref().expect("just computed");
let line_height = self.editors.viewport.line_height;
@@ -324,7 +334,7 @@ impl Workbench {
pub(super) fn diff_side_by_side(&self) -> bool {
let configured = self.setting("diffEditor.renderSideBySide") != json!(false);
let limited = self.setting("diffEditor.useInlineViewWhenSpaceIsLimited") != json!(false);
- configured && !(limited && self.diff_part_width.get() > 0. && self.diff_part_width.get() < INLINE_BREAKPOINT)
+ configured && !(limited && self.editors.diff_part_width.get() > 0. && self.editors.diff_part_width.get() < INLINE_BREAKPOINT)
}
/// diffEditorHelper.ts `hintWhitespace`: a diff whose only differences are trimmed whitespace shows a
@@ -543,7 +553,7 @@ impl Workbench {
/// The diff editor below the breadcrumbs: side by side the original pane, its sash and the modified code editor,
/// inline the modified code editor alone, then the diff overview ruler.
pub(in crate::workbench) fn diff_editor_body(&self, input: &DiffInput, modified: &OpenEditor, window: &mut Window, cx: &mut Context<Self>) -> Div {
- let part_width = self.diff_part_width.clone();
+ let part_width = self.editors.diff_part_width.clone();
let measure = canvas(move |bounds, _, _| part_width.set(f32::from(bounds.size.width)), |_, _, _, _| {}).absolute().inset_0();
let mut body = div().flex_1().min_h_0().relative().flex().child(measure);
let original = input.original_editor.as_ref().or_else(|| self.editors.model(&input.original.scheme, &input.original.path));
@@ -583,13 +593,14 @@ impl Workbench {
.when(!input.inline_now, |pane| pane.border_l_1().border_color(border))
.children(self.code_editor_area(modified, window, cx))
.when(!input.inline_now, |pane| pane.when_some(shadow, |pane, shadow| pane.child(div().absolute().top_0().bottom_0().left(px(-6.)).w(px(6.)).child(side_shadow(shadow)))));
- body.child(modified_pane).child(self.diff_overview(input, modified, cx).w(px(DIFF_OVERVIEW_WIDTH)).flex_none().h_full())
+ // testResultsOutput.ts `diffEditorOptions`: `renderOverviewRuler: false`.
+ body.child(modified_pane).when(!input.embedded, |body| body.child(self.diff_overview(input, modified, cx).w(px(DIFF_OVERVIEW_WIDTH)).flex_none().h_full()))
}
/// Side by side, the original pane's width: left of the sash, which splits the width left of the overview ruler
/// (diffEditorWidget.ts), less the gutter taken from the original editor.
fn diff_original_pane_width(&self, input: &DiffInput) -> f32 {
- let width = self.diff_part_width.get() - DIFF_OVERVIEW_WIDTH;
+ let width = self.editors.diff_part_width.get() - if input.embedded { 0. } else { DIFF_OVERVIEW_WIDTH };
let sash_left = (width / 2.).floor().clamp(MINIMUM_EDITOR_WIDTH.min(width / 2.), (width - MINIMUM_EDITOR_WIDTH).max(width / 2.));
sash_left - self.diff_gutter_width(input)
}
@@ -695,8 +706,8 @@ impl Workbench {
}
}
- /// A view zone of a diff side's code editor: a diff zone's view, an unchanged region's placeholder, else empty
- /// whitespace.
+ /// A view zone of a diff side's code editor: a diff zone's view, an unchanged region's placeholder, a test
+ /// result's Expected or Actual title, else empty whitespace.
pub(super) fn view_zone_body(&self, editor: &OpenEditor, id: u32, height: f32, content_left: f32, cx: &mut Context<Self>) -> Div {
if let Some(deleted) = self.quick_diff_deleted_zone(editor, id, content_left) {
return deleted.flex_none();
@@ -713,7 +724,7 @@ impl Workbench {
}
match placed_zones.iter().find(|placed| placed.0 == id) {
Some((_, zone)) => self.diff_zone_view(zone, self.editors.viewport.line_height, content_left).flex_none(),
- None => div().flex_none().h(px(height)),
+ None => self.testing_diff_lens(editor, id, height, content_left).unwrap_or_else(|| div().h(px(height))).flex_none(),
}
}
diff --git a/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs b/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
index 1bdceca28b1..45834203689 100644
--- a/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
@@ -761,7 +761,7 @@ impl Workbench {
/// Each is (side, left, width).
fn multi_diff_columns(&self, file: &FileDiff, side_by_side: bool, metrics: EditorMetrics) -> Vec<(ZoneSide, f32, f32)> {
let (original_width, gutter_width) = self.multi_diff_split(file, side_by_side);
- let part_width = self.diff_part_width.get();
+ let part_width = self.editors.diff_part_width.get();
let modified_left = original_width + gutter_width;
if side_by_side {
return vec![(ZoneSide::Original, 0., original_width), (ZoneSide::Modified, modified_left + 1., part_width - modified_left - 1.)];
@@ -797,7 +797,7 @@ impl Workbench {
let Some(input) = self.editors.active_multi_diff() else { return Vec::new() };
let side_by_side = self.diff_side_by_side();
let line_height = self.multi_diff_line_height();
- let part_width = self.diff_part_width.get();
+ let part_width = self.editors.diff_part_width.get();
let window_height = f32::from(window.viewport_size().height);
let mut hosts = Vec::new();
let mut file_top = 0.;
@@ -1151,7 +1151,7 @@ impl Workbench {
fn multi_diff_list(&self, window: &mut Window, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
let id = self.editors.active_tab().expect("drawn for the active tab").model_id;
let input = &self.editors.multi_diffs[&id];
- let (part_width, view_height) = (self.diff_part_width.clone(), input.view_height.clone());
+ let (part_width, view_height) = (self.editors.diff_part_width.clone(), input.view_height.clone());
let measure = canvas(
move |bounds, _, _| {
part_width.set(f32::from(bounds.size.width));
@@ -1268,7 +1268,7 @@ impl Workbench {
fn multi_diff_split(&self, file: &FileDiff, side_by_side: bool) -> (f32, f32) {
let gutter_width = self.gutter_width(&self.multi_diff_hunk_actions(file, side_by_side));
match side_by_side {
- true => ((self.diff_part_width.get() / 2.).floor() - gutter_width, gutter_width),
+ true => ((self.editors.diff_part_width.get() / 2.).floor() - gutter_width, gutter_width),
false => (0., gutter_width),
}
}
diff --git a/native/crates/app/src/workbench/testing_results.rs b/native/crates/app/src/workbench/testing_results.rs
index ee9591b0764..2a2a36332fd 100644
--- a/native/crates/app/src/workbench/testing_results.rs
+++ b/native/crates/app/src/workbench/testing_results.rs
@@ -13,6 +13,7 @@ use super::hover::{HoverContent, HoverOptions};
use super::testing_item_menu::result_state_context;
use super::testing_view::state_icon;
use crate::commands::Outcome;
+use crate::diff_editor::{DIFF_EDITOR_SCHEME, DiffInput, Side};
use crate::editor::{TEST_RESULTS_GROUP, TextDocument};
use crate::menus::{MenuAction, MenuId, menu_actions, menu_group_actions};
use crate::testing::{GROUP_DEBUG, GROUP_RUN, ResultState, TEST_DATA_SCHEME, TestResult, parent_id};
@@ -124,15 +125,26 @@ fn is_error_message(message: &Value) -> bool {
message["type"] == 0
}
+/// testTypes.ts `ITestMessage.isDiffable`: an error message with both an expected and an actual value.
+fn is_diffable(message: &Value) -> bool {
+ is_error_message(message) && message["expected"].is_string() && message["actual"].is_string()
+}
+
/// PlainTextMessagePeek `update`: a string message that is no `TestMessageType.Output` and not `ITestMessage.isDiffable`.
fn is_plain_text_message(message: &Value) -> bool {
- let diffable = is_error_message(message) && !message["expected"].is_null() && !message["actual"].is_null();
- message["message"].is_string() && message["type"] != 1 && !diffable
+ message["message"].is_string() && message["type"] != 1 && !is_diffable(message)
}
-/// testingUri.ts `buildTestUri` of a `TestUriType.ResultMessage`, with its authority and query in the path as models keep them.
-fn message_path(result: &str, task: usize, test: &str, message: usize) -> PathBuf {
- PathBuf::from(format!("//results/{result}/message/{task}/{message}/TestFailureMessage?{test}"))
+/// testingUri.ts `TestUriParts` of a message's models.
+const MESSAGE_PART: &str = "TestFailureMessage";
+const EXPECTED_PART: &str = "ExpectedOutput";
+const ACTUAL_PART: &str = "ActualOutput";
+
+const DIFF_LENS_ZONE_HEIGHT: f32 = 20.;
+
+/// testingUri.ts `buildTestUri` of a result message's `part`, with its authority and query in the path as models keep them.
+fn message_path(result: &str, task: usize, test: &str, message: usize, part: &str) -> PathBuf {
+ PathBuf::from(format!("//results/{result}/message/{task}/{message}/{part}?{test}"))
}
/// `getResultChildren`: a node per task with its tests that ran or have messages, worst state first, each with
@@ -580,34 +592,83 @@ impl Workbench {
self.show_message_editor();
}
- /// PlainTextMessagePeek `update`: a plain text message opens as its `messageUri` model in a read-only code editor.
+ /// testResultsOutput.ts `DiffContentProvider` and `PlainTextMessagePeek` `update`: a diffable message opens its
+ /// `expectedUri` and `actualUri` models in an embedded diff editor, a plain text one its `messageUri` model in a
+ /// read-only code editor.
fn show_message_editor(&mut self) {
- let Some(InspectSubject::Message { result, task, test, message }) = &self.testing_view.results_subject else { return };
- let value = &self.result_by_id(result).expect("the subject is a result's").items[test].tasks[*task].messages[*message];
- if !is_plain_text_message(value) {
+ let Some(InspectSubject::Message { result, task, test, message }) = self.testing_view.results_subject.clone() else { return };
+ let value = self.result_by_id(&result).expect("the subject is a result's").items[&test].tasks[task].messages[message].clone();
+ let diffable = is_diffable(&value);
+ if !diffable && !is_plain_text_message(&value) {
return;
}
- let path = message_path(result, *task, test, *message);
- let text = super::debug_console::strip_ansi(message_text(value));
- let document = TextDocument::from_text(TEST_DATA_SCHEME, &path, &text, "utf8".into(), None, &self.languages, &self.settings.lock().unwrap());
+ let path = |part| message_path(&result, task, &test, message, part);
+ let document = |workbench: &Self, scheme, part, text: &str| TextDocument::from_text(scheme, &path(part), text, "utf8".into(), None, &workbench.languages, &workbench.settings.lock().unwrap());
self.editors.ensure_detached_group(TEST_RESULTS_GROUP);
self.with_group(TEST_RESULTS_GROUP, |workbench| {
- match workbench.editors.editors.first() {
- Some(editor) if editor.document().path == path => workbench.editors.activate(0),
- Some(_) => workbench.editors.replace(0, document),
- None => workbench.editors.open(document, false),
+ if workbench.editors.editors.first().is_some_and(|editor| editor.document().path == path(MESSAGE_PART)) {
+ workbench.editors.activate(0);
+ return;
}
- // wordHighlighter.ts runs on an explicit cursor move or the text focus, which a model set here is not.
- workbench.editors.active_mut().expect("just opened").highlights.clear();
+ let replaced = workbench.editors.editors.first().map(|editor| editor.model_id);
+ if diffable {
+ let (expected, actual) = (value["expected"].as_str().expect("diffable"), value["actual"].as_str().expect("diffable"));
+ for (part, text) in [(EXPECTED_PART, expected), (ACTUAL_PART, actual)] {
+ if workbench.editors.model(TEST_DATA_SCHEME, &path(part)).is_none() {
+ workbench.editors.open_model(document(workbench, TEST_DATA_SCHEME, part, text));
+ }
+ }
+ let side = |part| Side { scheme: TEST_DATA_SCHEME.into(), path: path(part) };
+ let input = DiffInput { embedded: true, ..DiffInput::new(side(EXPECTED_PART), side(ACTUAL_PART), None) };
+ workbench.editors.open_diff(document(workbench, DIFF_EDITOR_SCHEME, MESSAGE_PART, ""), input, false);
+ // DiffContentProvider `getOptions`: line numbers when either side is multiline.
+ let line_numbers = (expected.contains('\n') || actual.contains('\n')).then_some("on");
+ let id = workbench.editors.active_tab().expect("just opened").model_id;
+ let input = workbench.editors.diffs.get_mut(&id).expect("just opened");
+ for editor in [&mut input.original_editor, &mut input.modified_editor].into_iter().flatten() {
+ editor.line_numbers_override = line_numbers;
+ // testingDecorations.ts `TitleLensContentWidget`: a 20px zone above line 1 holds the side's title.
+ editor.add_view_zone(None, DIFF_LENS_ZONE_HEIGHT);
+ }
+ } else {
+ let text = super::debug_console::strip_ansi(message_text(&value));
+ workbench.editors.open(document(workbench, TEST_DATA_SCHEME, MESSAGE_PART, &text), false);
+ // wordHighlighter.ts runs on an explicit cursor move or the text focus, which a model set here is not.
+ workbench.editors.active_mut().expect("just opened").highlights.clear();
+ }
+ if let Some(replaced) = replaced {
+ let index = workbench.editors.editors.iter().position(|editor| editor.model_id == replaced).expect("not closed yet");
+ workbench.editors.close(index);
+ }
+ workbench.update_diff_editor();
});
}
- /// The code editor of the opened message, while it shows that message.
+ /// testingDecorations.ts `ExpectedLensContentWidget` and `ActualLensContentWidget`: the title above line 1 of an
+ /// expected or actual output model, bottom-aligned in the zone `id` that `show_message_editor` added.
+ pub(super) fn testing_diff_lens(&self, editor: &crate::editor::OpenEditor, id: u32, height: f32, content_left: f32) -> Option<Div> {
+ let document = editor.document();
+ let zone = editor.view_zone(id)?;
+ let title = match document.path.to_string_lossy() {
+ _ if document.scheme != TEST_DATA_SCHEME || zone.anchor.is_some() => return None,
+ path if path.contains(&format!("/{EXPECTED_PART}?")) => "Expected",
+ path if path.contains(&format!("/{ACTUAL_PART}?")) => "Actual",
+ _ => return None,
+ };
+ let setting = self.suggest_setting(editor, "editor.codeLensFontSize").as_f64().unwrap_or(0.);
+ let line_height = if setting < 5. { self.editors.viewport.line_height } else { self.code_lens_height() };
+ let family = self.suggest_setting(editor, "editor.codeLensFontFamily");
+ let family = family.as_str().filter(|family| !family.is_empty()).unwrap_or(super::peek_view::UI_FONT).to_owned();
+ let label = div().absolute().bottom_0().left(px(content_left)).h(px(line_height)).whitespace_nowrap().font_family(family).text_size(px(self.code_lens_font_size())).line_height(px(line_height)).text_color(self.color("editorCodeLens.foreground")).child(title);
+ Some(div().h(px(height)).relative().child(label))
+ }
+
+ /// The tab of the opened message's code or diff editor, while it shows that message.
fn message_editor(&self) -> Option<&crate::editor::OpenEditor> {
let Some(InspectSubject::Message { result, task, test, message }) = &self.testing_view.results_subject else { return None };
let in_group = self.editors.id == TEST_RESULTS_GROUP || self.editors.group(TEST_RESULTS_GROUP).is_some();
- let path = message_path(result, *task, test, *message);
- self.editors.group_tabs(TEST_RESULTS_GROUP).0.first().filter(|editor| in_group && editor.document().is(TEST_DATA_SCHEME, &path))
+ let path = message_path(result, *task, test, *message, MESSAGE_PART);
+ self.editors.group_tabs(TEST_RESULTS_GROUP).0.first().filter(|editor| in_group && editor.document().path == path)
}
/// The Test Results view: the opened subject's text and, by `testing.resultsView.layout`, the tree on its right
@@ -727,13 +788,21 @@ impl Workbench {
.child(self.hover_target(gpui::SharedString::from(format!("results-action-hover-{}", action.title)), HoverContent::Text(action.title), HoverOptions::action_item()))
}
- /// The subject: a plain text message in its code editor, else a task's or a test's output as plain lines; a message
- /// with testResultsViewContent.ts `populateFloatingClick`'s button.
+ /// The subject: a diffable message in its diff editor, a plain text one in its code editor, else a task's or a
+ /// test's output as plain lines; a message with testResultsViewContent.ts `populateFloatingClick`'s button.
fn results_content(&mut self, window: &mut Window, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
if self.message_editor().is_some() {
let body = |workbench: &mut Self, window: &mut Window, cx: &mut Context<Self>| {
+ // A diff's unfocused side editor draws before the body, as editor_groups.rs `editor_group_body` does.
+ workbench.draw_unfocused_code_editors(window, cx);
let editor = workbench.editors.active().expect("the message's editor");
- div().flex_1().min_h_0().flex().flex_col().child(workbench.text_area(editor, window, cx))
+ let body = div().flex_1().min_h_0().flex().flex_col();
+ let body = match workbench.editors.active_diff() {
+ Some(diff) => body.child(workbench.diff_editor_body(diff, diff.modified_editor.as_ref().unwrap_or(editor), window, cx)),
+ None => body.child(workbench.text_area(editor, window, cx)),
+ };
+ workbench.unfocused_code_editors_placed();
+ body
};
let editor = match self.editors.id == TEST_RESULTS_GROUP {
true => body(self, window, cx),
diff --git a/native/crates/app/src/workbench/testing_results/tests.rs b/native/crates/app/src/workbench/testing_results/tests.rs
index 8b848bc6845..8f8dd1c206c 100644
--- a/native/crates/app/src/workbench/testing_results/tests.rs
+++ b/native/crates/app/src/workbench/testing_results/tests.rs
@@ -60,6 +60,39 @@ fn an_opened_plain_text_message_shows_in_a_read_only_code_editor(cx: &mut TestAp
});
}
+/// testResultsOutput.ts `DiffContentProvider`: an opened diffable message shows its expected and actual models side by
+/// side in an embedded diff editor, with line numbers when a side is multiline; a plain text message replaces it.
+#[gpui::test]
+fn an_opened_diffable_message_shows_expected_and_actual_in_a_diff_editor(cx: &mut TestAppContext) {
+ let (workbench, cx, _host) = workbench_with_tests("test-results-diff", TESTS, cx);
+ workbench.update_in(cx, |workbench, window, _| {
+ add_results(workbench);
+ workbench.testing.results[0].append_message("c\0f\0b", "t1", json!({ "type": 0, "message": "not equal", "expected": "1\n2", "actual": "1\n3", "contextValue": null, "location": null }));
+ workbench.open_results_element(&ResultsElement::Message { result: "r1".into(), task: 0, test: "c\0f\0b".into(), message: 1 });
+ let tab = workbench.message_editor().expect("the message's diff editor").model_id;
+ workbench.with_group(crate::editor::TEST_RESULTS_GROUP, |workbench| {
+ let diff = workbench.editors.diffs.get(&tab).expect("a diff editor");
+ let side = |editor: &Option<crate::editor::OpenEditor>| editor.as_ref().map(|editor| (editor.document().uri_string(), editor.document().lines.clone()));
+ assert_eq!(side(&diff.original_editor), Some(("vscode-test-data://results/r1/message/0/1/ExpectedOutput?c%00f%00b".to_owned(), vec!["1".to_owned(), "2".to_owned()])));
+ assert_eq!(side(&diff.modified_editor), Some(("vscode-test-data://results/r1/message/0/1/ActualOutput?c%00f%00b".to_owned(), vec!["1".to_owned(), "3".to_owned()])));
+ assert!(diff.embedded && !diff.inline_now);
+ assert_eq!(diff.diff.as_ref().map(|computed| computed.diff.changes.len()), Some(1));
+ assert_eq!(workbench.line_numbers(diff.modified_editor.as_ref().expect("attached")), crate::workbench::editor_view::LineNumbers::On);
+ // lineNumbersMinChars 5 (36px) and '2ch' (14px) decorations; the glyph margin (18px) on the original only.
+ let mut content_left = |editor: &Option<crate::editor::OpenEditor>| workbench.editor_metrics(editor.as_ref().expect("attached"), window).content_left();
+ assert_eq!((content_left(&diff.original_editor), content_left(&diff.modified_editor)), (68., 50.));
+ for editor in [&diff.original_editor, &diff.modified_editor] {
+ let editor = editor.as_ref().expect("attached");
+ let zones: Vec<_> = editor.view_zones.iter().filter(|zone| zone.anchor.is_none()).map(|zone| (zone.height, workbench.testing_diff_lens(editor, zone.id, zone.height, 0.).is_some())).collect();
+ assert_eq!(zones, vec![(20., true)], "the side's title zone above line 1");
+ }
+ });
+ workbench.open_results_element(&ResultsElement::Message { result: "r1".into(), task: 0, test: "c\0f\0b".into(), message: 0 });
+ assert!(workbench.message_editor().is_some());
+ assert!(!workbench.editors.diffs.contains_key(&tab));
+ });
+}
+
fn drawn_rows(workbench: &Workbench) -> Vec<String> {
workbench
.results_rows()
diff --git a/port/fixtures/extensions/tests-provider/extension.js b/port/fixtures/extensions/tests-provider/extension.js
index b5c524faef9..6a0ff2bbcb5 100644
--- a/port/fixtures/extensions/tests-provider/extension.js
+++ b/port/fixtures/extensions/tests-provider/extension.js
@@ -1,4 +1,5 @@
-// Each `test('name', ...)` line of a *.test.js file is one test; a test whose line says `fail` fails.
+// Each `test('name', ...)` line of a *.test.js file is one test; a test whose line says `fail` fails, with a
+// diffable message when the line also has `expected "..." actual "..."` (JSON strings).
const vscode = require('vscode');
exports.activate = async function (context) {
@@ -11,7 +12,7 @@ exports.activate = async function (context) {
file.canResolveChildren = true;
controller.items.add(file);
}
- const failing = new Set();
+ const failing = new Map();
controller.resolveHandler = async item => {
if (!item) {
return;
@@ -23,7 +24,10 @@ exports.activate = async function (context) {
const test = controller.createTestItem(`${item.id}/${match[1]}`, match[1], item.uri);
test.range = new vscode.Range(index, 0, index, line.length);
if (line.includes('fail')) {
- failing.add(test.id);
+ const diff = /expected (".*") actual (".*")/.exec(line);
+ failing.set(test.id, diff
+ ? vscode.TestMessage.diff('Expected values to be strictly equal', JSON.parse(diff[1]), JSON.parse(diff[2]))
+ : new vscode.TestMessage(`${match[1]} failed`));
}
item.children.add(test);
}
@@ -41,7 +45,7 @@ exports.activate = async function (context) {
run.started(test);
run.appendOutput(`running ${test.label}\r\n`, undefined, test);
if (failing.has(test.id)) {
- run.failed(test, new vscode.TestMessage(`${test.label} failed`), 5);
+ run.failed(test, failing.get(test.id), 5);
} else {
run.passed(test, 3);
}
diff --git a/port/fixtures/testing-messages/compare.test.js b/port/fixtures/testing-messages/compare.test.js
new file mode 100644
index 00000000000..7b7db031114
--- /dev/null
+++ b/port/fixtures/testing-messages/compare.test.js
@@ -0,0 +1 @@
+test('fails to compare', () => {}); // expected "1\nfoo 2 bar\n3" actual "1\nfoo 4 bar\n3"
diff --git a/port/ledger.md b/port/ledger.md
index 9f843010180..177f4ef4811 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -602,7 +602,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_results.rs `results_content`: an output, a diffable message and a markdown message are plain text lines, not testResultsOutput.ts's terminal, diff and markdown peeks; a plain text message's ANSI colors are stripped (`colorizeTestMessageInEditor`); 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 the_results_tree_moves_its_focus_with_the_list_commands a_results_rows_menu_shows_its_actions_and_the_contributed_items an_opened_message_shows_the_first_message_content_item an_opened_plain_text_message_shows_in_a_read_only_code_editor 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/testing | workbench contribution | M16 | ported | [3 M] testing_results.rs `results_content`: an output and a markdown message are plain text lines, not testResultsOutput.ts's terminal and markdown peeks; the content and tree split in half where the reference splits them about 2:1 (testResultsViewContent.ts `SplitView`); a plain text message's ANSI colors are stripped (`colorizeTestMessageInEditor`); 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 the_results_tree_moves_its_focus_with_the_list_commands a_results_rows_menu_shows_its_actions_and_the_contributed_items an_opened_ 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); ui-pair port/fixtures/testing-messages (diff message); 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.md
index 3548d79d6c5..fab04b713ee 100644
--- a/port/notes.md
+++ b/port/notes.md
@@ -880,7 +880,7 @@ Scope as in the M19 Work row of port/ledger.md.
- 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.
- Test Results tree (`workbench/testing_results.rs`; testResultsTree.ts `OutputPeekTree`): rows drawn as the workbench tree rows (4px inset, rounded, `list_row_selection`, indent guides, listCommands.ts keys while focused); a new run selects and focuses its first task without taking the focus (`revealItem` with `preserveFocus`). Decision: the task row always shows its twistie when it has children. The reference renders the task row while the task is still childless (`onNewTask`), and abstractTree.ts `renderTreeElement` redraws a twistie only on a collapse state change, so the reference shows no twistie until the row is toggled or rendered again; the port draws the state a fresh render gives.
- Test resolution timing: treeProjection.ts `storeItem` expands only depth-0 items, the controller roots; a single root's children show on the explorer's top level collapsed (index.ts `getChildrenForParent`, `depth > 0`) and resolve only when the user expands them, and testService.ts `testsInFile` yields an open file's item without expanding it. The port expanded those file items at publish, so the tests-provider fixture's `resolveHandler` ran for every file and Run All ran each test, where the reference's run handler finds the unresolved file item and runs it as one test (`math.test.js` without children in the results). `TestCollection::apply` now answers only the roots.
-- Test Results content editors (`workbench/testing_results.rs`; testResultsOutput.ts content providers): the view's code editors live in `TEST_RESULTS_GROUP`, a group outside the grid like the Output view's `PANEL_GROUP` (`is_panel_group`), so they select, copy and take the editor keys through the same code; `PlainTextMessagePeek` opens a plain text message's `messageUri` model (`vscode-test-data://results/<result>/message/<task>/<message>/TestFailureMessage?<test>`) there read-only, without line numbers, glyph margin, minimap or `scrollBeyondLastLine` (`commonEditorOptions`). Shortcut: ANSI escapes in the message are stripped, not colored as `colorizeTestMessageInEditor` does.
+- Test Results content editors (`workbench/testing_results.rs`; testResultsOutput.ts content providers): the view's code editors live in `TEST_RESULTS_GROUP`, a group outside the grid like the Output view's `PANEL_GROUP` (`is_panel_group`), so they select, copy and take the editor keys through the same code; `PlainTextMessagePeek` opens a plain text message's `messageUri` model (`vscode-test-data://results/<result>/message/<task>/<message>/TestFailureMessage?<test>`) there read-only, without line numbers, glyph margin, minimap or `scrollBeyondLastLine` (`commonEditorOptions`). Shortcut: ANSI escapes in the message are stripped, not colored as `colorizeTestMessageInEditor` does. `DiffContentProvider` opens a diffable message (an error with string `expected` and `actual`) as an embedded diff of its `ExpectedOutput` and `ActualOutput` models (`DiffInput.embedded`): `diffEditorOptions` fixes the options (side by side, no overview ruler, `ignoreTrimWhitespace` false, unchanged regions shown) instead of reading `diffEditor.*`, line numbers turn on when either side is multiline, and a 20px zone above line 1 holds the "Expected" and "Actual" titles (testingDecorations.ts `TitleLensContentWidget`). The editors are built outside a text editor part, so `lineNumbersMinChars` is the default 5, and only the original side has a glyph margin (`_adjustOptionsForLeftHandSide`). The diff's `diff_part_width` moved to the group state, since the results diff and an editor area diff lay out at once. ui-pair port/fixtures/testing-messages (`compare.test.js`): gutters, fills and titles match; the reference splits the content and tree about 2:1 where the port splits them in half (`TestResultsViewContent.lastSplitWidth`), open.
- 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.