Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(debug): keyboard focus, selection and column border in the disassembly table

rokarturf0282dc671b0
diff --git a/native/crates/app/src/list_tree.rs b/native/crates/app/src/list_tree.rs
index 820758b1d50..238fdc1de55 100644
--- a/native/crates/app/src/list_tree.rs
+++ b/native/crates/app/src/list_tree.rs
@@ -49,10 +49,23 @@ pub fn reveal_scroll_top(list: ListScroll, index: usize, center: bool) -> Option
/// listWidget.ts `focusNextPage` and `focusPreviousPage`: the last (first) row of the page, else one page on. Gives
/// the row to focus and the new scroll top, none when the list cannot move.
pub fn page_focus(list: ListScroll, down: bool, focus: Option<usize>) -> Option<(usize, f32)> {
- let ListScroll { count, row_height, viewport, scroll_top } = list;
+ page_focus_rows(&vec![list.row_height; list.count], list.viewport, list.scroll_top, down, focus)
+}
+
+/// `page_focus` over rows of their own heights.
+pub fn page_focus_rows(heights: &[f32], viewport: f32, scroll_top: f32, down: bool, focus: Option<usize>) -> Option<(usize, f32)> {
+ let count = heights.len();
+ let max_scroll_top = (heights.iter().sum::<f32>() - viewport).max(0.);
let edge_row = |scroll_top: f32| -> usize {
// rangeMap.ts `indexAt`: `count` past the last row.
- let index = |y: f32| ((y / row_height).floor() as usize).min(count);
+ let index = |y: f32| {
+ let mut top = 0.;
+ heights.iter().position(|height| {
+ top += height;
+ top > y
+ })
+ .unwrap_or(count)
+ };
match down {
true => index(scroll_top + viewport).saturating_sub(1),
false if scroll_top <= 0. => 0,
@@ -67,8 +80,8 @@ pub fn page_focus(list: ListScroll, down: bool, focus: Option<usize>) -> Option<
if focus != Some(edge) && on_page {
return Some((edge, scroll_top));
}
- let step = if down && focus.is_some_and(|focus| edge > focus) { viewport - row_height } else { viewport };
- let next_scroll_top = if down { scroll_top + step } else { scroll_top - step }.clamp(0., list.max_scroll_top());
+ let step = if down && focus.is_some_and(|focus| edge > focus) { viewport - heights[edge] } else { viewport };
+ let next_scroll_top = if down { scroll_top + step } else { scroll_top - step }.clamp(0., max_scroll_top);
(next_scroll_top != scroll_top).then(|| (edge_row(next_scroll_top), next_scroll_top))
}
diff --git a/native/crates/app/src/list_tree/tests.rs b/native/crates/app/src/list_tree/tests.rs
index fc4310b69b4..f2ccd5c0dc6 100644
--- a/native/crates/app/src/list_tree/tests.rs
+++ b/native/crates/app/src/list_tree/tests.rs
@@ -25,6 +25,14 @@ fn page_down_focuses_the_last_row_on_the_page() {
let long = ListScroll { count: 20, row_height: 18., viewport: 90., scroll_top: 0. };
assert_eq!(page_focus(long, true, Some(0)), Some((4, 0.)));
}
+
+/// The disassembly table's rows with source lines are taller: the page edge and the step count their heights.
+#[test]
+fn page_down_counts_each_rows_height() {
+ let heights = [18., 36., 18., 18., 18., 18.];
+ assert_eq!(page_focus_rows(&heights, 72., 0., true, Some(0)), Some((2, 0.)));
+ assert_eq!(page_focus_rows(&heights, 72., 0., true, Some(2)), Some((5, 54.)));
+}
#[test]
fn nested_parents_stick_up_to_the_item_count_and_40_percent_of_the_view() {
// a/ b/ c/ with ten files in c, 22px rows.
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index 5b71f40c2c2..94361aed94b 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -804,7 +804,7 @@ impl Workbench {
inlay_hints: Default::default(),
debug_inline_values: Default::default(),
debug_hover: Default::default(),
- disassembly_view: Default::default(),
+ disassembly_view: disassembly_view::DisassemblyView::new(cx),
color_detector: Default::default(),
inline_completions: Default::default(),
language_detection: Default::default(),
diff --git a/native/crates/app/src/workbench/debug_commands.rs b/native/crates/app/src/workbench/debug_commands.rs
index b7a5d5f9ea6..650f0deaeac 100644
--- a/native/crates/app/src/workbench/debug_commands.rs
+++ b/native/crates/app/src/workbench/debug_commands.rs
@@ -512,6 +512,7 @@ impl Workbench {
context.insert("disassembleRequestSupported".into(), json!(focused.is_some_and(|session| session.capabilities["supportsDisassembleRequest"] == true)));
context.insert("focusedStackFrameHasInstructionReference".into(), json!(self.debug.focused_frame().is_some_and(|frame| frame.instruction_pointer_reference.is_some())));
context.insert("disassemblyViewFocus".into(), json!(self.disassembly_view_active()));
+ self.disassembly_list_context(window, context);
let language = self.editors.active().filter(|editor| editor.document().scheme == "file").map(|editor| editor.document().language_id.clone());
context.insert("languageSupportsDisassembleRequest".into(), json!(language.is_some_and(|language| self.debug.debuggers.iter().any(|debugger| debugger.interested_in_language(&language)))));
let simple = state == State::Inactive && !self.workspace_folders().iter().any(|folder| !self.folder_launch(folder).configurations.is_empty());
diff --git a/native/crates/app/src/workbench/disassembly_view.rs b/native/crates/app/src/workbench/disassembly_view.rs
index 3880978d603..a8bf6add6f5 100644
--- a/native/crates/app/src/workbench/disassembly_view.rs
+++ b/native/crates/app/src/workbench/disassembly_view.rs
@@ -5,7 +5,7 @@
use std::collections::HashMap;
use std::path::{Path, PathBuf};
-use gpui::{AnyElement, ClickEvent, Context, Div, ListAlignment, ListOffset, ListState, Task, Window, div, list, prelude::*, px};
+use gpui::{AnyElement, App, ClickEvent, Context, Div, FocusHandle, ListAlignment, ListOffset, ListState, MouseButton, Task, Window, div, list, prelude::*, px};
use serde_json::{Value, json};
use super::debug_service::answer;
@@ -29,11 +29,16 @@ pub struct DisassemblyView {
hovered_glyph: Option<u64>,
/// The lines of the source files the rows show, read when their instructions load.
sources: HashMap<PathBuf, Vec<String>>,
+ /// The table's focus and its focused and selected rows, by address (`identityProvider`) so loads keep them.
+ focus: FocusHandle,
+ focused: Option<u64>,
+ selected: Option<u64>,
+ hovered: bool,
}
-impl Default for DisassemblyView {
- fn default() -> Self {
- Self { model: Disassembly::default(), list: ListState::new(0, ListAlignment::Top, px(200.)), loading: false, last_top: 0, hovered_glyph: None, sources: HashMap::new() }
+impl DisassemblyView {
+ pub fn new(cx: &mut App) -> Self {
+ Self { model: Disassembly::default(), list: ListState::new(0, ListAlignment::Top, px(200.)), loading: false, last_top: 0, hovered_glyph: None, sources: HashMap::new(), focus: cx.focus_handle(), focused: None, selected: None, hovered: false }
}
}
@@ -62,7 +67,7 @@ impl Workbench {
let _ = workbench.update(cx, |workbench, cx| workbench.disassembly_scrolled(event.visible_range.clone(), cx));
});
if let Some(reference) = self.focused_instruction_reference() {
- self.reload_disassembly(reference, 0, cx);
+ self.reload_disassembly(reference, 0, window, cx);
}
}
self.editors_changed(cx);
@@ -86,8 +91,10 @@ impl Workbench {
/// `onDidChangeState`: a new debug run starts with an empty view.
pub(super) fn clear_disassembly(&mut self) {
- self.disassembly_view.model.clear();
- self.disassembly_view.list.reset(0);
+ let view = &mut self.disassembly_view;
+ view.model.clear();
+ view.list.reset(0);
+ (view.focused, view.selected) = (None, None);
}
/// `goToInstructionAndOffset`: an unknown reference loads the instructions around it first.
@@ -116,14 +123,14 @@ impl Workbench {
}
}
- /// `reloadDisassembly`: the view empties and loads 400 instructions around the reference, centered on it.
- fn reload_disassembly(&mut self, reference: String, offset: i64, cx: &mut Context<Self>) {
+ /// `reloadDisassembly`: the view empties and loads 400 instructions around the reference, centered and focused on it.
+ fn reload_disassembly(&mut self, reference: String, offset: i64, window: &mut Window, cx: &mut Context<Self>) {
self.disassembly_view.loading = true;
self.clear_disassembly();
let load = self.load_instructions(reference.clone(), offset, -INSTRUCTIONS_TO_LOAD * 4, INSTRUCTIONS_TO_LOAD * 8, cx);
- cx.spawn(async move |workbench, cx| {
+ cx.spawn_in(window, async move |workbench, cx| {
load.await;
- let _ = workbench.update(cx, |workbench, cx| {
+ let _ = workbench.update_in(cx, |workbench, window, cx| {
let line_height = workbench.disassembly_line_height();
let view = &mut workbench.disassembly_view;
view.loading = false;
@@ -138,6 +145,9 @@ impl Workbench {
// `reveal(targetIndex, 0.5)`: the row in the middle of the view.
let rows = (view.list.viewport_bounds().size.height / px(line_height)) as usize;
view.list.scroll_to(ListOffset { item_ix: target.saturating_sub(rows / 2), offset_in_item: px(0.) });
+ // "Always focus the target address on reload, or arrow key navigation would look terrible".
+ view.focused = view.model.entries.get(target).map(|entry| entry.address);
+ window.focus(&view.focus.clone(), cx);
cx.notify();
});
})
@@ -222,16 +232,34 @@ impl Workbench {
}
/// The editor body: the breakpoint column and the instruction column of each row, or "Disassembly not
- /// available." while no instruction is loaded.
- pub(super) fn disassembly_editor_body(&self, cx: &mut Context<Self>) -> Div {
+ /// available." while no instruction is loaded. A click focuses the table without moving its focused row
+ /// (`mouseSupport: false`).
+ pub(super) fn disassembly_editor_body(&self, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
let line_height = self.disassembly_line_height();
- let body = div().flex_1().min_h_0().flex().flex_col().bg(self.color("editor.background")).text_color(self.color("foreground"));
- if self.disassembly_view.model.entries.is_empty() {
+ let view = &self.disassembly_view;
+ let body = div()
+ .id("disassembly-view")
+ .relative()
+ .flex_1()
+ .min_h_0()
+ .flex()
+ .flex_col()
+ .bg(self.color("editor.background"))
+ .text_color(self.color("foreground"))
+ .track_focus(&view.focus)
+ .on_mouse_down(MouseButton::Left, cx.listener(|workbench, _, window, cx| window.focus(&workbench.disassembly_view.focus.clone(), cx)))
+ .on_hover(cx.listener(|workbench, hovered: &bool, _, cx| {
+ workbench.disassembly_view.hovered = *hovered;
+ cx.notify();
+ }));
+ if view.model.entries.is_empty() {
let row = div().h(px(line_height)).flex().child(div().w(px(line_height)).flex_none()).child(self.disassembly_text("Disassembly not available."));
return body.child(row);
}
- let rows = list(self.disassembly_view.list.clone(), cx.processor(|workbench: &mut Workbench, index: usize, _, cx| workbench.disassembly_row(index, cx))).size_full();
- body.child(rows)
+ let rows = list(view.list.clone(), cx.processor(|workbench: &mut Workbench, index: usize, window, cx| workbench.disassembly_row(index, window, cx))).size_full();
+ // table.css: the disabled sash after the fixed breakpoint column draws the column border on hover.
+ let border = (view.hovered || self.is_motion_reduced()).then(|| self.theme.color("tree.tableColumnsBorder")).flatten();
+ body.child(rows).when_some(border, |body, border| body.child(div().absolute().top(px(1.)).bottom_0().left(px(line_height)).w(px(1.)).bg(border)))
}
fn disassembly_text(&self, text: impl Into<gpui::SharedString>) -> Div {
@@ -239,10 +267,14 @@ impl Workbench {
div().font_family(super::editor_view::EDITOR_FONT).text_size(px(super::editor_view::EDITOR_FONT_SIZE * zoom)).line_height(px(self.disassembly_line_height())).whitespace_nowrap().child(text.into())
}
- fn disassembly_row(&mut self, index: usize, cx: &mut Context<Self>) -> AnyElement {
+ fn disassembly_row(&mut self, index: usize, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
let line_height = self.disassembly_line_height();
- let entry = &self.disassembly_view.model.entries[index];
+ let view = &self.disassembly_view;
+ let entry = &view.model.entries[index];
let address = entry.address;
+ let table_focused = view.focus.is_focused(window);
+ let row_focused = view.focused == Some(address);
+ let row_selected = view.selected == Some(address);
let (tops, focused_top, focused) = self.instruction_pointer_addresses();
let source = self.disassembly_source_lines(entry);
let instruction = instruction_text(&entry.instruction);
@@ -268,17 +300,88 @@ impl Workbench {
);
}
column = column.child(self.disassembly_text(instruction).when_some(background, |text, background| text.bg(background)));
+ // listWidget.ts styles: the selection active or inactive by the table's focus, the focus outline only while
+ // the table has focus, the hover on rows neither focused nor selected.
+ let selection = match (row_selected, table_focused) {
+ (false, _) => None,
+ (true, true) => Some((self.color("list.activeSelectionBackground"), self.theme.color("list.activeSelectionForeground"))),
+ (true, false) => Some((self.color("list.inactiveSelectionBackground"), self.theme.color("list.inactiveSelectionForeground"))),
+ };
+ let outline = self.theme.color("list.focusOutline").filter(|_| row_focused && table_focused);
let hover = self.color("list.hoverBackground");
div()
.id(("disassembly-row", index))
+ .relative()
.w_full()
.flex()
- .hover(move |row| row.bg(hover))
+ .when(!row_focused && !row_selected, |row| row.hover(move |row| row.bg(hover)))
+ .when_some(selection, |row, (background, foreground)| row.bg(background).when_some(foreground, |row, foreground| row.text_color(foreground)))
.child(self.disassembly_glyph(index, address, focused_top, focused, line_height, cx))
.child(column)
+ .when_some(outline, |row, outline| row.child(div().absolute().inset_0().border_1().border_color(outline)))
.into_any_element()
}
+ /// The row heights `DisassemblyView`'s delegate gives: the instruction's line and its source lines.
+ fn disassembly_row_heights(&self) -> Vec<f32> {
+ let line_height = self.disassembly_line_height();
+ self.disassembly_view.model.entries.iter().map(|entry| line_height * (1 + self.disassembly_source_lines(entry).map_or(0, |lines| lines.len())) as f32).collect()
+ }
+
+ /// list.contribution.ts `listFocus` and `listHasSelectionOrFocus` while the table has focus.
+ pub(super) fn disassembly_list_context(&self, window: &Window, context: &mut HashMap<String, Value>) {
+ let view = &self.disassembly_view;
+ if view.focus.is_focused(window) {
+ context.insert("listFocus".into(), json!(true));
+ context.insert("listHasSelectionOrFocus".into(), json!(view.focused.is_some() || view.selected.is_some()));
+ }
+ }
+
+ /// The list commands on the focused table (`multipleSelectionSupport: false`): the focus moves and reveals,
+ /// `list.select` selects the focused row, `list.clear` drops selection and focus.
+ pub(super) fn disassembly_list_command(&mut self, id: &str, window: &mut Window, cx: &mut Context<Self>) -> bool {
+ if !self.disassembly_view.focus.is_focused(window) {
+ return false;
+ }
+ let heights = self.disassembly_row_heights();
+ let view = &mut self.disassembly_view;
+ let count = view.model.entries.len();
+ if count == 0 {
+ return true;
+ }
+ let focus = view.focused.and_then(|address| view.model.index_of_address(address));
+ let last = count - 1;
+ let next = match id {
+ "list.focusDown" | "list.focusAnyDown" => focus.map_or(0, |index| (index + 1).min(last)),
+ "list.focusUp" | "list.focusAnyUp" => focus.map_or(0, |index| index.saturating_sub(1)),
+ "list.focusFirst" | "list.focusAnyFirst" => 0,
+ "list.focusLast" | "list.focusAnyLast" => last,
+ "list.focusPageDown" | "list.focusPageUp" => {
+ let top = view.list.logical_scroll_top();
+ let scroll_top = heights[..top.item_ix].iter().sum::<f32>() + f32::from(top.offset_in_item);
+ let viewport = f32::from(view.list.viewport_bounds().size.height);
+ let Some((target, scroll_top)) = crate::list_tree::page_focus_rows(&heights, viewport, scroll_top, id == "list.focusPageDown", focus) else { return true };
+ view.list.scroll_to(list_offset(&heights, scroll_top));
+ target
+ }
+ "list.select" => {
+ view.selected = view.focused;
+ cx.notify();
+ return true;
+ }
+ "list.clear" => {
+ (view.focused, view.selected) = (None, None);
+ cx.notify();
+ return true;
+ }
+ _ => return true,
+ };
+ view.focused = Some(view.model.entries[next].address);
+ view.list.scroll_to_reveal_item(next);
+ cx.notify();
+ true
+ }
+
/// `BreakpointRenderer`: the frame arrow, the breakpoint, or under the pointer the hint; a click removes the
/// breakpoint by its address (#289678) or adds one.
fn disassembly_glyph(&self, index: usize, address: u64, focused_top: Option<u64>, focused: Option<u64>, line_height: f32, cx: &mut Context<Self>) -> impl IntoElement {
@@ -350,6 +453,18 @@ impl Workbench {
}
}
+/// The row and the offset in it at `scroll_top`.
+fn list_offset(heights: &[f32], scroll_top: f32) -> ListOffset {
+ let mut top = 0.;
+ for (item_ix, height) in heights.iter().enumerate() {
+ if top + height > scroll_top {
+ return ListOffset { item_ix, offset_in_item: px(scroll_top - top) };
+ }
+ top += height;
+ }
+ ListOffset { item_ix: heights.len(), offset_in_item: px(0.) }
+}
+
/// The address padded to 25 columns, the bytes to 30 (at least 10 spaces after each), then the instruction.
fn instruction_text(instruction: &Value) -> String {
let mut text = String::new();
@@ -441,6 +556,17 @@ mod tests {
let addresses = workbench.read_with(cx, |workbench, _| workbench.disassembly_view.model.entries.iter().map(|entry| entry.address).collect::<Vec<_>>());
assert_eq!(addresses, vec![0xffc, 0x1000, 0x1004]);
+ let table = |cx: &mut gpui::VisualTestContext| workbench.update_in(cx, |workbench, window, _| (workbench.disassembly_view.focus.is_focused(window), workbench.disassembly_view.focused, workbench.disassembly_view.selected, workbench.key_context(window).get("listFocus").cloned()));
+ assert_eq!(table(cx), (true, Some(0x1000), None, Some(json!(true))), "the reload focuses the table on the frame's row");
+ let run = |id: &str, cx: &mut gpui::VisualTestContext| workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command(id, Vec::new(), window, cx)));
+ run("list.focusDown", cx);
+ run("list.select", cx);
+ assert_eq!(table(cx), (true, Some(0x1004), Some(0x1004), Some(json!(true))));
+ run("list.focusFirst", cx);
+ assert_eq!(table(cx), (true, Some(0xffc), Some(0x1004), Some(json!(true))), "the focus moves without the selection");
+ run("list.clear", cx);
+ assert_eq!(table(cx), (true, None, None, Some(json!(true))));
+
workbench.update(cx, |workbench, cx| workbench.toggle_instruction_breakpoint(0x1004, cx));
cx.run_until_parked();
let sent = requests(&host).into_iter().find(|request| request["command"] == "setInstructionBreakpoints").expect("the breakpoint is sent");
diff --git a/native/crates/app/src/workbench/search_actions.rs b/native/crates/app/src/workbench/search_actions.rs
index e337f34d75b..508b3e23d23 100644
--- a/native/crates/app/src/workbench/search_actions.rs
+++ b/native/crates/app/src/workbench/search_actions.rs
@@ -410,7 +410,7 @@ impl Workbench {
for id in super::explorer_keyboard::EXPLORER_LIST_COMMANDS {
let search_run = commands.iter().find(|(search_id, _)| *search_id == id).map(|(_, run)| *run);
self.commands.register(id, move |workbench, _, window, cx| {
- if workbench.keybindings_table_list_command(id, window, cx) || workbench.references_peek_list_command(id, window, cx) || workbench.hierarchy_peek_list_command(id, window, cx) || workbench.debug_hover_list_command(id, window, cx) || workbench.notebook_list_command(id, window, cx) || workbench.multi_diff_file_list_command(id, window, cx) || workbench.scm_repositories_list_command(id, window, cx) {
+ if workbench.keybindings_table_list_command(id, window, cx) || workbench.references_peek_list_command(id, window, cx) || workbench.hierarchy_peek_list_command(id, window, cx) || workbench.debug_hover_list_command(id, window, cx) || workbench.notebook_list_command(id, window, cx) || workbench.multi_diff_file_list_command(id, window, cx) || workbench.scm_repositories_list_command(id, window, cx) || workbench.disassembly_list_command(id, window, cx) {
return Outcome::done();
}
match search_run {
diff --git a/port/ledger.md b/port/ledger.md
index fa992ab2a16..90bca755ea5 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -475,7 +475,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/commands | workbench contribution | M9 | verified | | runCommands (commands.rs register_run_commands): cargo test -p app commands::, argument checks, spread args, order, stop at a failure; argument errors and the failure notify (cargo test -p app run_commands_argument_errors_notify) |
| workbench/contrib/comments | workbench contribution | M13 | verified | | Done: a reply and an edit form per thread and comment, open together (commentReply.ts per CommentThreadWidget): cargo test -p app two_threads_keep_their_reply_forms_open_together; a zone sized by the drawn comment bodies: cargo test -p app a_wrapped_comment_body_grows_its_zone; next/previous thread and Focus Comment on Current Line focus the thread's comments (`commentFocused`, Up/Down between comments, Escape collapses and selects the range): cargo test -p app the_reached_thread_takes_the_focus. Done in diff editors: glyphs, commenting ranges (asked for every side of every multi diff file), range highlights and zones on both sides of the diff editor and of each multi diff file, the other side aligned by a diagonal fill (workbench/editor_view/diff_editor_view.rs, multi_diff_editor_view.rs, diff_editor.rs `additional_heights`): cargo test -p app diff comment; ui-pair `portComments.openDiff` modified, original and multi. Floating widgets on a diff's original side and on both sides of each multi diff file (comment_thread_floating.rs `FloatingHost`, multi_diff_editor_view.rs `multi_diff_floating_hosts`), with `FloatingWidgetRoom` growing a file below its last line (commentThreadFloatingWidgetRoom.ts, `FileDiff.room`): cargo test -p app floating room multi_diff; ui-pair `portComments.openDiff` original and multi with the floating style. Range decorations (commentThreadRangeDecorator.ts and the floating empty-range line, workbench/comment_thread_widget.rs `comment_range_highlights`): cargo test -p app comment_thread_floating. The floating thread style (`comments.thread.experimental.style: floating`; workbench/comment_thread_floating_layout.rs with commentThreadFloatingWidget.test.ts ported, workbench/comment_thread_floating.rs: placement beside the code or its lines in code order, the outline and connector, title drag, edge resize, double-click reset, the layout kept per thread, wheel to the editor): cargo test -p app comment_thread_floating, ui-pair steps-comment-floating.json (port/results/language-features.md Floating comment threads). Done: the Comments panel (workbench/comments_view.rs: resources, threads with author, relative time, first line, range and replies, the unresolved badge, a markdown preview's images as "Image: {alt}" (cargo test -p app a_markdown_comment_previews_its_first_rendered_block), the filter box with Show Resolved/Unresolved and Sort By, its history in the memento's `filterHistory`, Escape and Cmd+Down while `commentsFilterFocus` (cargo test -p app the_filter_keeps_its_history_and_escape_clears_it; no match highlights, as commentsTreeViewer.ts's renderers ignore the filter data), Collapse/Expand All, row selection and keys; hideIfEmpty; a thread row's `commentsView/commentThread/context` inline actions and context menu with the built-in Reply, which reveals the thread with its zone expanded and reply open: cargo test -p app the_thread_menu_replies_to_the_thread), the gutter glyph that toggles the thread (workbench/editor_view/comment_glyph.rs) and the thread widget (workbench/comment_thread_widget.rs: zone, state colors, head with `comments/commentThread/title` actions and Collapse, markdown comments with `code` spans on no `textCodeBlock.background` (cargo test -p app a_comment_s_code_span_draws_no_code_block_background), reply form with `comments/commentThread/context` buttons and Cmd+Enter), each comment (workbench/comment_node.rs: `comments/comment/title` actions, edit mode with `comments/comment/context` buttons, reactions and their picker), commenting ranges with the add glyph, Add Comment and template threads (workbench/commenting_ranges.rs), the comment commands (workbench/comment_navigation.rs: Collapse/Expand All, Expand Unresolved, Toggle Editor Commenting, Focus Comment on Current Line, Dismiss Comment, next/previous thread, commented range and commenting range, reached at the provider's columns unless it holds the cursor: cargo test -p app a_commenting_range_is_reached_at_its_columns_unless_it_holds_the_cursor) and the comments accessibility help: cargo test -p app comment; ui-pair port/results/language-features.md (Comments, Comment editing and commands); Escape keeps a new template open as the reference does (ui-pair steps-comment-escape-typed.json, cargo test -p app dismissing_a_new_template_keeps_it_open). The reply and edit inputs are code editors (simpleCommentEditor.ts: a `comment`-scheme markdown model, word wrap, no glyph margin, line numbers or folding, `scrollBeyondLastLine` false, 5 to 25 lines by `calculateEditorHeight`) that take the focus with `commentEditorFocused`, Cmd+Enter submits and Escape hides; the host gets the input's document and no text editor (workbench/comment_thread_widget.rs `open_comment_editor`, workbench/editor.rs `comment_editor`): cargo test -p app an_expanded_thread_shows_a_zone_and_replies_run_the_form_actions a_comment_switched_to_editing_runs_the_edit_actions; ui-pair steps-comment-reply-editor.json (reply-empty, reply-lines, reply-grown). Comments panel rows: 4px pane inset, 4px radius and the tree's indent guides as the Problems tree (cargo test -p app rows_sit_in_the_pane_s_inset_with_the_tree_s_indent_and_guides; ui-pair steps-comments.json: chevron, name and thread line at the reference's x and y) |
| workbench/contrib/customEditor | workbench contribution | M17 | verified | | Each editor of a custom text editor's resource, the one opened in another group and a split's copy, has a webview of its own (customEditorInput.ts: cargo test -p app each_group_s_custom_text_editor_has_its_own_webview); Opening a custom text editor with `options.selection` reveals it in the panel and leaves the text model's cursor (cargo test -p app a_custom_text_editor_s_navigation_drives_the_outline); A custom document open in another group moves to the active one, or with `supportsMultipleEditorsPerDocument` gets a second editor there (editorResolverService.ts `moveExistingEditorForResource`: cargo test -p app a_custom_document_open_in_another_group_moves_to_the_active_one a_custom_document_with_multiple_editors_opens_one_more_in_the_active_group); `workbench.editorAssociations` merged as editorResolverService.ts `getAllUserAssociationsForSetting`: the workspace's globs before the default's and user's (cargo test -p app a_workspace_association_wins_over_a_user_one_of_the_same_length); Reopen Editor With puts a closed custom or notebook editor's replacement in its place, pinned (editorGroupView.ts `replaceEditors`: cargo test -p app a_reopened_preview_keeps_its_tab_position); Two default editors for one resource warn once and remember the choice per extension glob (editorResolverService.ts `doHandleConflictingDefaults`: cargo test -p app two_default_editors_for_a_resource_ask_once_which_to_keep); the memento's custom editors until the extensions register (cargo test -p app markdown_editor_files_offer); editor resolution by `workbench.editorAssociations` and contributed selectors (editorResolverService.ts ranks), Reopen Editor With picker (`reopenActiveEditorWith`, `workbench.action.reopenWithEditor`), `_workbench.open`, `_workbench.openWith`; `FIXTURE=custom-editor-tests port/tools/webview-check` 8/8; cargo test -p app custom_editors |
-| workbench/contrib/debug | workbench contribution | M16 | ported | [3 M] disassembly_view.rs: the instruction table has no keyboard focus, selection or column sash (disassemblyView.ts WorkbenchTable) <br> [3 M] debug_view.rs: against the reference with js-debug (ui-pair `debug/call-stack-menu.json`, `FOLDER=port/fixtures/debug-node`) the Call Stack has no row for the child session `app.js` with its `Paused On Breakpoint` label, the folded frames read `Show 7 More Stack Frames` instead of `Show 7 More: Skipped by skipFiles`, and a right-clicked row gets no focus outline <br> [3 L] variable context menus: DebugVariablesContext, DebugWatchContext and DebugHoverContext (Copy Value, Copy as Expression, Add to Watch, Set Value, Break When Value Is Read/Changes/Is Accessed, View Binary Data) not ported <br> [3 L] debug visualizers: debugVisualizers.ts, `VisualizedExpression` rows in the Variables view and the hover not ported <br> [3 M] lazy variables: `presentationHint.lazy` rows and their reveal button (baseDebugView.ts `lazyButton`) not ported in the hover, Variables or Watch <br> [3 M] debug_hover.rs: Alt+click on an expandable hover row (abstractTree.ts `toggleCollapsed(location, recursive)`) expands one level, not the whole subtree <br> [3 M] debug_hover.rs: the hover tree has no find widget (abstractTree.ts `FindController`, `list.find`) | ui-pair port/fixtures/debug-node: gutter breakpoint, F5 stops at it, Variables (Local: main), Call Stack with folded deemphasized frames, Breakpoints, Debug Console REPL, toolbar, status bar entry; cargo test -p app debug; Breakpoints header `$(warning)` hint for the debugger's `strings.unverifiedBreakpoints` after breakpointsView.ts's 4s `hintDelayer`, restarted by every breakpoint change (cargo test -p app debug_view; ui-pair port/fixtures/ui-pair/debug/unverified-breakpoints.json with js-debug's unbound math.test.js breakpoint); preLaunchTask, postDebugTask, compound preLaunchTask and the restart tasks through debugTaskRunner.ts's runner with `debug.onTaskErrors`, the remembered task error choice and the slow task notification (cargo test -p app debug_task_runner); Run to Cursor's temporary breakpoint with debugService.ts `runTo`'s 2s verification wait, thread choice from the sessions that verified it, and removal at the next stop or session end (cargo test -p app debug_commands); Debug Console output styled by its SGR sequences with the theme's ANSI colors at contrast 4 (cargo test -p app debug_console debug::ansi); Debug Console filter box (replFilter.ts terms, "Showing N of M" badge, Cmd+F `repl.action.filter`, value and history in workspace storage) and session picker (consoles of the sessions with `hasSeparateRepl`, `mergeWithParent` children in the parent's, selection focuses the session or its stopped child), input history in workspace storage (`debug.repl.history`) (cargo test -p app debug_console); ended sessions stay inactive in the console picker with their output until Clear Console or a start of the same configuration (debugModel.ts `addSession`, repl.ts `sessionsToIgnore`; cargo test -p app an_ended_session_stays_in_the_picker_until_cleared_or_started_again); debugUtils.ts `saveAllBeforeDebugStart` before a start (not for a child session or with `suppressSaveBeforeStart`) and a restart, by `debug.saveBeforeStart` (cargo test -p app a_start_or_restart_saves_the_dirty_editors); triggered breakpoints: debugSession.ts `enableDependentBreakpoints` by `hitBreakpointIds` or the top frame's position sets `sessionsDidTrigger` and sends the files again, continue and the steps wait for it up to 1.5 s (`waitForTriggeredBreakpoints`), a restart clears it (cargo test -p app a_hit_breakpoint_enables_its_dependents); `debug.inlineValues` after the focused frame's lines: the `InlineValuesProvider`s' values (`$provideInlineValues`) or the most specific scopes' variables named on each line, their `formatHoverContent` hover, the 100ms removal on continue (cargo test -p app debug_inline_values); debugHover.ts in place of the editor hover while a frame is focused in the file: the `$provideEvaluatableExpression` range or the dotted path under the mouse, `hover` evaluation or the scopes' variable, Cmd+K Cmd+I focused, Alt for the editor hover, the tree's list keys and `layoutTree` height, the glyph margin's lockout release, the caret edge nearer the mouse (cargo test -p app debug_hover; ui-pair port/fixtures/debug-node `greeting` and `numbers` hovers); disassemblyView.ts: the `disassemble` requests around the focused frame's instruction pointer, the glyph click's instruction breakpoint (`setInstructionBreakpoints`), the Breakpoints view's instruction rows, `instruction` stepping granularity while the view is active (cargo test -p app disassembly a_step_in_the_disassembly_view debug::tests::instruction_breakpoints debug::tests::remove_instruction_breakpoints); shortcuts in port/notes.md |
+| workbench/contrib/debug | workbench contribution | M16 | ported | [3 M] debug_view.rs: against the reference with js-debug (ui-pair `debug/call-stack-menu.json`, `FOLDER=port/fixtures/debug-node`) the Call Stack has no row for the child session `app.js` with its `Paused On Breakpoint` label, the folded frames read `Show 7 More Stack Frames` instead of `Show 7 More: Skipped by skipFiles`, and a right-clicked row gets no focus outline <br> [3 L] variable context menus: DebugVariablesContext, DebugWatchContext and DebugHoverContext (Copy Value, Copy as Expression, Add to Watch, Set Value, Break When Value Is Read/Changes/Is Accessed, View Binary Data) not ported <br> [3 L] debug visualizers: debugVisualizers.ts, `VisualizedExpression` rows in the Variables view and the hover not ported <br> [3 M] lazy variables: `presentationHint.lazy` rows and their reveal button (baseDebugView.ts `lazyButton`) not ported in the hover, Variables or Watch <br> [3 M] debug_hover.rs: Alt+click on an expandable hover row (abstractTree.ts `toggleCollapsed(location, recursive)`) expands one level, not the whole subtree <br> [3 M] debug_hover.rs: the hover tree has no find widget (abstractTree.ts `FindController`, `list.find`) | ui-pair port/fixtures/debug-node: gutter breakpoint, F5 stops at it, Variables (Local: main), Call Stack with folded deemphasized frames, Breakpoints, Debug Console REPL, toolbar, status bar entry; cargo test -p app debug; Breakpoints header `$(warning)` hint for the debugger's `strings.unverifiedBreakpoints` after breakpointsView.ts's 4s `hintDelayer`, restarted by every breakpoint change (cargo test -p app debug_view; ui-pair port/fixtures/ui-pair/debug/unverified-breakpoints.json with js-debug's unbound math.test.js breakpoint); preLaunchTask, postDebugTask, compound preLaunchTask and the restart tasks through debugTaskRunner.ts's runner with `debug.onTaskErrors`, the remembered task error choice and the slow task notification (cargo test -p app debug_task_runner); Run to Cursor's temporary breakpoint with debugService.ts `runTo`'s 2s verification wait, thread choice from the sessions that verified it, and removal at the next stop or session end (cargo test -p app debug_commands); Debug Console output styled by its SGR sequences with the theme's ANSI colors at contrast 4 (cargo test -p app debug_console debug::ansi); Debug Console filter box (replFilter.ts terms, "Showing N of M" badge, Cmd+F `repl.action.filter`, value and history in workspace storage) and session picker (consoles of the sessions with `hasSeparateRepl`, `mergeWithParent` children in the parent's, selection focuses the session or its stopped child), input history in workspace storage (`debug.repl.history`) (cargo test -p app debug_console); ended sessions stay inactive in the console picker with their output until Clear Console or a start of the same configuration (debugModel.ts `addSession`, repl.ts `sessionsToIgnore`; cargo test -p app an_ended_session_stays_in_the_picker_until_cleared_or_started_again); debugUtils.ts `saveAllBeforeDebugStart` before a start (not for a child session or with `suppressSaveBeforeStart`) and a restart, by `debug.saveBeforeStart` (cargo test -p app a_start_or_restart_saves_the_dirty_editors); triggered breakpoints: debugSession.ts `enableDependentBreakpoints` by `hitBreakpointIds` or the top frame's position sets `sessionsDidTrigger` and sends the files again, continue and the steps wait for it up to 1.5 s (`waitForTriggeredBreakpoints`), a restart clears it (cargo test -p app a_hit_breakpoint_enables_its_dependents); `debug.inlineValues` after the focused frame's lines: the `InlineValuesProvider`s' values (`$provideInlineValues`) or the most specific scopes' variables named on each line, their `formatHoverContent` hover, the 100ms removal on continue (cargo test -p app debug_inline_values); debugHover.ts in place of the editor hover while a frame is focused in the file: the `$provideEvaluatableExpression` range or the dotted path under the mouse, `hover` evaluation or the scopes' variable, Cmd+K Cmd+I focused, Alt for the editor hover, the tree's list keys and `layoutTree` height, the glyph margin's lockout release, the caret edge nearer the mouse (cargo test -p app debug_hover; ui-pair port/fixtures/debug-node `greeting` and `numbers` hovers); disassemblyView.ts: the `disassemble` requests around the focused frame's instruction pointer, the glyph click's instruction breakpoint (`setInstructionBreakpoints`), the Breakpoints view's instruction rows, `instruction` stepping granularity while the view is active, the table's focus on reload, the list keys' focus, selection and clear, Page Up/Down over the rows' own heights, the hover column border (cargo test -p app disassembly list_tree a_step_in_the_disassembly_view debug::tests::instruction_breakpoints debug::tests::remove_instruction_breakpoints); shortcuts in port/notes.md |
| workbench/contrib/dropOrPasteInto | workbench contribution | M13 | verified | | commands.ts `configurePreferredPasteAction`/`configurePreferredDropAction`: the widgets' menus and the Paste As pick open user settings JSON at `editor.pasteAs.preferences` or `editor.dropIntoEditor.preferences` (workbench/paste_edits.rs); the `editor.pasteAs.*` and `editor.dropIntoEditor.*` settings come from core-settings.json; ui-pair paste-menu (port/results/language-features.md) |
| workbench/contrib/editSessions | workbench contribution | | removed | | no sign-in/AI by decision (port/notes.md); not ported |
| workbench/contrib/editTelemetry | workbench contribution | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert |