Visual Studio Code, rebuilt in Rust
Rust
fix(editor): move, click and select over inlay hints as upstream
rokarture48ba2aad591
diff --git a/README.md b/README.mdindex fccadad442c..a94d9a4c9bf 100644--- a/README.md+++ b/README.md@@ -11,8 +11,8 @@ Coverage of VS Code 1.147.0, from [port/ledger.md](port/ledger.md) (584 rows). V```mermaidpie showData- "verified" : 409- "ported" : 21+ "verified" : 410+ "ported" : 20"removed" : 126"n/a" : 28```@@ -24,14 +24,14 @@ pie showData| built-in extension | 88 | 1 | 6 | 0 | `████████████████████ 99%` || MainThread* shape (Rust side) | 59 | 0 | 30 | 0 | `████████████████████ 100%` || workbench service | 59 | 6 | 23 | 7 | `██████████████████░░ 91%` |-| src/vs/editor/contrib | 53 | 1 | 2 | 1 | `████████████████████ 98%` |+| src/vs/editor/contrib | 54 | 0 | 2 | 1 | `████████████████████ 100%` || workbench part | 10 | 1 | 2 | 0 | `██████████████████░░ 91%` || extension host seam | 7 | 0 | 0 | 0 | `████████████████████ 100%` || cross-cutting check | 5 | 0 | 0 | 0 | `████████████████████ 100%` || src/vs/editor | 0 | 2 | 1 | 1 | `░░░░░░░░░░░░░░░░░░░░ 0%` || src/vs/base | 0 | 0 | 2 | 3 | `████████████████████ 100%` || port feature | 1 | 0 | 0 | 0 | `████████████████████ 100%` |-| **all** | **409** | **21** | **126** | **28** | `███████████████████░ 95%` |+| **all** | **410** | **20** | **126** | **28** | `███████████████████░ 95%` |<!-- coverage:end -->`removed` are parts left out by decision: AI features, Microsoft services, telemetry, remote and tunnels ([port/notes.md](port/notes.md)). `n/a` are upstream test infrastructure and the Electron process, IPC and DOM layers the native architecture replaces.diff --git a/native/crates/app/src/editor/cursor.rs b/native/crates/app/src/editor/cursor.rsindex c34c1a5d4c2..3f86d0a933e 100644--- a/native/crates/app/src/editor/cursor.rs+++ b/native/crates/app/src/editor/cursor.rs@@ -4,6 +4,7 @@use std::ops::Range;+use super::injected_text::InjectedText;use super::{Indentation, folding, graphemes};#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]@@ -130,21 +131,87 @@ pub fn right(lines: &[String], position: Position) -> Position {/// `MoveOperations.vertical` on view lines: keeps the visible column, plus what the line could not hold/// (`leftover`, negative after a jump to the end of the last line), and moves to the document's/// edge when there is no line to go to. Lines in `hidden` are folded away and skipped.-// shortcut: visible columns count the model text only, where upstream's view line also counts the injected chars-// before the column; a move past an inlay hint lands that many columns off.pub fn vertical(lines: &[String], hidden: &[Range<usize>], position: Position, leftover: isize, down: bool, tab_size: usize) -> (Position, isize) {- let visible_of = |position: Position| super::logical_visible_column(&lines[position.line], position.column, tab_size) as isize;- let visible = visible_of(position) + leftover;+ vertical_over_injections(lines, &[], hidden, position, 0, leftover, down, tab_size)+}++/// `vertical` where the visible columns count the `injected` chars of the view line (`position` is `past` of the+/// ones at its column); a column touching injections goes after them down, before them up (`RightOfInjectedText`,+/// `LeftOfInjectedText`).+#[allow(clippy::too_many_arguments)]+pub fn vertical_over_injections(lines: &[String], injected: &[InjectedText], hidden: &[Range<usize>], position: Position, past: usize, leftover: isize, down: bool, tab_size: usize) -> (Position, isize) {+ let from = ViewLine::new(lines, injected, position.line);+ let visible = from.visible(from.view_column(position.column, past), tab_size) + leftover;let last_line = folding::last_shown_line(lines.len(), hidden);let last = Position::new(last_line, line_len(lines, last_line));let was_at_edge = if down { position == last } else { position == Position::default() };- let moved = match folding::shown_neighbour(lines.len(), hidden, position.line, down) {- None if down => last,- None => Position::default(),- Some(line) => Position::new(line, column_from_visible(&lines[line], visible.max(0) as usize, tab_size)),+ // (position, its visible column before the normalization, how many view columns the normalization moved it back)+ let (moved, moved_visible, normalized_back) = match folding::shown_neighbour(lines.len(), hidden, position.line, down) {+ None if down => {+ let to = ViewLine::new(lines, injected, last_line);+ (last, to.visible(to.view_column(last.column, usize::MAX), tab_size), 0)+ }+ None => (Position::default(), 0, 0),+ Some(line) => {+ let to = ViewLine::new(lines, injected, line);+ let view_column = column_from_visible(&to.text, visible.max(0) as usize, tab_size);+ let (column, normalized) = to.model_column(view_column, down);+ (Position::new(line, column), to.visible(view_column, tab_size), view_column as isize - normalized as isize)+ }};- let leftover = if was_at_edge { 0 } else { visible - visible_of(moved) };- (moved, leftover)+ let leftover = if was_at_edge { 0 } else { visible - moved_visible };+ (moved, leftover + normalized_back)+}++/// A model line as the view model has it: the injected chars before the char at their column.+struct ViewLine {+ text: String,+ /// The view columns the injections at each model column start and end at, `len + 1` entries.+ bounds: Vec<(usize, usize)>,+ /// The char count of each injection on the line, by column.+ injections: Vec<(usize, usize)>,+}++impl ViewLine {+ fn new(lines: &[String], injected: &[InjectedText], line: usize) -> Self {+ let first = injected.partition_point(|injection| injection.position.line < line);+ let injections: Vec<_> = injected[first..].iter().take_while(|injection| injection.position.line == line).map(|injection| (injection.position.column, &injection.content)).collect();+ let mut text = String::new();+ let mut bounds = Vec::new();+ let mut view = 0;+ let model: Vec<char> = lines[line].chars().collect();+ for column in 0..=model.len() {+ let start = view;+ for (_, content) in injections.iter().filter(|(at, _)| *at == column) {+ text.push_str(content);+ view += content.chars().count();+ }+ bounds.push((start, view));+ if let Some(&c) = model.get(column) {+ text.push(c);+ view += 1;+ }+ }+ ViewLine { text, bounds, injections: injections.into_iter().map(|(column, content)| (column, content.chars().count())).collect() }+ }++ fn visible(&self, view_column: usize, tab_size: usize) -> isize {+ super::logical_visible_column(&self.text, view_column, tab_size) as isize+ }++ /// The view column of model `column` after `past` of the injections there.+ fn view_column(&self, column: usize, past: usize) -> usize {+ let passed: usize = self.injections.iter().filter(|(at, _)| *at == column).take(past).map(|(_, chars)| chars).sum();+ self.bounds[column].0 + passed+ }++ /// The model column of `view_column` and the view column it normalizes to: after the injections it touches+ /// going down, before them going up (`getInjectedTextAtOffset` counts both ends).+ fn model_column(&self, view_column: usize, down: bool) -> (usize, usize) {+ let column = self.bounds.iter().position(|&(start, end)| start <= view_column && view_column <= end).expect("a view column is in a model column's bounds");+ let (start, end) = self.bounds[column];+ (column, if down { end } else { start })+ }}/// `MoveOperations.translateUp`/`translateDown` for one position: `vertical`, but on the first or lastdiff --git a/native/crates/app/src/editor/edit.rs b/native/crates/app/src/editor/edit.rsindex 47066ff2304..3655f496680 100644--- a/native/crates/app/src/editor/edit.rs+++ b/native/crates/app/src/editor/edit.rs@@ -277,13 +277,16 @@ impl OpenEditor {}let tab_size = self.document().indentation.tab_size;let hidden = self.folding.hidden().to_vec();+ let injected = self.injected_text.clone();+ let mut heads_past = (0..self.selections.len()).map(|index| self.head_past_injections(index)).collect::<Vec<_>>().into_iter();self.move_cursors(select, |lines, selection, leftover| {- let from = match (select || selection.is_empty(), down) {- (true, _) => selection.head,- (false, false) => selection.start(),- (false, true) => selection.end(),+ let head_past = heads_past.next().expect("one past count per cursor");+ let (from, past) = match (select || selection.is_empty(), down) {+ (true, _) => (selection.head, head_past),+ (false, false) => (selection.start(), if selection.start() == selection.head { head_past } else { 0 }),+ (false, true) => (selection.end(), if selection.end() == selection.head { head_past } else { 0 }),};- cursor::vertical(lines, &hidden, from, leftover, down, tab_size)+ cursor::vertical_over_injections(lines, &injected, &hidden, from, past, leftover, down, tab_size)});self.set_heads_past_all_injections(down);}diff --git a/native/crates/app/src/editor/injected_text.rs b/native/crates/app/src/editor/injected_text.rsindex 06025f2ded4..9cda228d328 100644--- a/native/crates/app/src/editor/injected_text.rs+++ b/native/crates/app/src/editor/injected_text.rs@@ -116,8 +116,8 @@ pub struct LineLayout {text_x: Vec<f32>,/// The visible column each char starts at, the injected chars before it counted (`_renderLine`'s `visibleColumn`).visible: Vec<usize>,- /// (char column, width) of each injection, by column.- injections: Vec<(usize, f32)>,+ /// (char column, width, width of its last char) of each injection, by column.+ injections: Vec<(usize, f32, f32)>,}impl LineLayout {@@ -138,7 +138,7 @@ impl LineLayout {visible += char_columns(c, visible, tab_size);text_x.push(x);}- LineLayout { text_x, visible: visible_at, injections: injections.into_iter().map(|(column, width, _)| (column, width)).collect() }+ LineLayout { text_x, visible: visible_at, injections: injections.into_iter().map(|(column, width, content)| (column, width, width / content.chars().count().max(1) as f32)).collect() }}/// The visible column char `column` starts at, the injected chars before it counted.@@ -151,7 +151,7 @@ impl LineLayout {}fn injected_before(&self, column: usize, including_column: bool) -> f32 {- self.injections.iter().take_while(|(at, _)| *at < column || (including_column && *at == column)).map(|(_, width)| width).sum()+ self.injections.iter().take_while(|(at, ..)| *at < column || (including_column && *at == column)).map(|(_, width, _)| width).sum()}/// `PositionAffinity.None`: a position at an injection is before it, as the cursor draws.@@ -163,7 +163,7 @@ impl LineLayout {/// A cursor at `column` after `past` of the injections there.pub fn cursor_x(&self, column: usize, past: usize) -> f32 {let column = column.min(self.len());- let at_column = self.injections.iter().filter(|(at, _)| *at == column).take(past).map(|(_, width)| width).sum::<f32>();+ let at_column = self.injections.iter().filter(|(at, ..)| *at == column).take(past).map(|(_, width, _)| width).sum::<f32>();self.x(column) + at_column}@@ -175,8 +175,6 @@ impl LineLayout {/// `convertModelRangeToViewRange`: an empty range sits before the injections at it; a range starts after/// the injections at its start and ends before the ones at its end.- // shortcut: a selection whose head sits after an injection at its end still ends before it, where upstream's view- // range covers it; take the head's `past` here when selections over hints matter.pub fn range(&self, start: usize, end: usize) -> (f32, f32) {match start == end {true => (self.x(start), self.x(start)),@@ -191,20 +189,31 @@ impl LineLayout {/// The model column nearest to `x` for a click: a char takes the clicks up to its middle, a click on an/// injection goes to its column.- // shortcut: a click on an injection lands before it, where upstream lands after an inlay hint or color box when- // the click is past the middle of its last char; return a `past` count when clicks on hints matter.pub fn column_at(&self, x: f32) -> usize {- for column in 0..self.len() {- let start = self.char_x(column);- if x < start {- return column;+ self.position_at(x).0+ }++ /// The view position nearest to `x` for a click (`caretRangeFromPoint`), as (model column, injections there+ /// it is past): an injection takes the clicks up to the middle of its last char, the char after it the clicks up+ /// to its own middle, both after the injection.+ pub fn position_at(&self, x: f32) -> (usize, usize) {+ let mut injections = self.injections.iter().peekable();+ for column in 0..=self.len() {+ let mut left = self.x(column);+ let mut past = 0;+ while let Some((_, width, last_char)) = injections.next_if(|(at, ..)| *at == column) {+ if x < left + width {+ return (column, if x > left + width - last_char / 2. { past + 1 } else { past });+ }+ left += width;+ past += 1;}// `columnFromVisibleColumn`: the left column on a tie.- if x <= (start + self.x(column + 1)) / 2. {- return column;+ if column == self.len() || x <= (left + self.x(column + 1)) / 2. {+ return (column, past);}}- self.len()+ unreachable!("the last column returns")}/// `column_at` as the x of the model text alone, which the click handlers take.@@ -218,7 +227,7 @@ impl LineLayout {/// The injections of the line with their x, for drawing.pub fn injection_x(&self) -> impl Iterator<Item = (usize, f32)> + '_ {- self.injections.iter().enumerate().map(|(index, &(column, _))| (index, self.text_x[column.min(self.len())] + self.injections[..index].iter().map(|(_, width)| width).sum::<f32>()))+ self.injections.iter().enumerate().map(|(index, &(column, ..))| (index, self.text_x[column.min(self.len())] + self.injections[..index].iter().map(|(_, width, _)| width).sum::<f32>()))}}@@ -245,6 +254,31 @@ impl OpenEditor {self.past_injections = (!heads.is_empty()).then(|| (self.selections.clone(), heads));}+ /// A press at x `layout_x` of model line `line` that put the last cursor at its column: it rests past the+ /// injections the press was past (`normalizePosition` with `PositionAffinity.None`).+ pub fn click_past_injections(&mut self, line: usize, layout_x: f32) {+ let (column, past) = self.line_layout(line).position_at(layout_x);+ let head = self.selections.last().expect("an editor has a cursor").head;+ if head == Position::new(line, column) {+ let heads: Vec<_> = self.selections.iter().map(|selection| (selection.head, if selection.head == head { past } else { 0 })).collect();+ self.set_heads_past_injections(heads);+ }+ }++ /// The x range of cursor `index`'s selection over columns `start..end` of `layout`'s model line `line`: `range`,+ /// its head's edge at the head's view position (`viewState.selection`), past the injections it moved over.+ pub fn selection_x(&self, index: usize, layout: &LineLayout, line: usize, start: usize, end: usize) -> (f32, f32) {+ let selection = self.selections[index];+ let (mut left, mut right) = layout.range(start, end);+ if selection.head == Position::new(line, end) && selection.head > selection.anchor {+ right = layout.cursor_x(end, self.head_past_injections(index));+ }+ if selection.head == Position::new(line, start) && selection.head < selection.anchor {+ left = layout.cursor_x(start, self.head_past_injections(index));+ }+ (left, right)+ }+fn cursor_stops(&self, position: Position) -> Vec<CursorStops> {self.injected_text_on(position.line).iter().filter(|injection| injection.position.column == position.column).map(|injection| injection.owner.cursor_stops()).collect()}diff --git a/native/crates/app/src/editor/injected_text/tests.rs b/native/crates/app/src/editor/injected_text/tests.rsindex e9a8bba409f..90a12429bb7 100644--- a/native/crates/app/src/editor/injected_text/tests.rs+++ b/native/crates/app/src/editor/injected_text/tests.rs@@ -82,11 +82,37 @@ fn cursor_moves_stop_after_an_inlay_hint() {editor.set_selections(vec![crate::editor::Selection::caret(Position::new(2, 2))]);editor.move_vertically(false, false);assert_eq!(head(&editor), (2, 0));+ // `MoveOperations.vertical` counts the hint's chars of the view line "f(abc1);abc": down from "f(1|" keeps visible+ // column 6, up from "abcd|" lands in the hint and goes before it.+ editor.set_selections(vec![crate::editor::Selection::caret(Position::new(1, 3))]);+ editor.move_vertically(true, false);+ assert_eq!(editor.selection().head, Position::new(2, 4));+ editor.set_selections(vec![crate::editor::Selection::caret(Position::new(2, 4))]);+ editor.move_vertically(false, false);+ assert_eq!(head(&editor), (2, 0));// End goes to the view line's max column, after a hint at the line's end.editor.move_to_line_edge(true, false);assert_eq!(head(&editor), (5, 1));}+/// mouseTarget.ts hit test, then `normalizePosition` with `PositionAffinity.None`: a press past the middle of a hint's+/// last char, or on the first half of the char after it, rests after the hint; a selection with its head there covers it.+#[test]+fn a_press_past_the_middle_of_a_hints_last_char_lands_after_it() {+ let layout = LineLayout::new("abcd", 4, [(2, 3., "abc")]);+ assert_eq!([1.6, 4.4, 4.6, 5.4, 5.6].map(|x| layout.position_at(x)), [(2, 0), (2, 0), (2, 1), (2, 1), (3, 0)]);+ let mut editor = crate::editor::edit::tests::editor("abcd", "\n");+ let hint = InjectedText { position: Position::new(0, 2), columns: 3., content: "abc".into(), wrap: WrapWidth::Chars, owner: InjectionOwner::InlayHint, id: 0, at_range_start: true };+ editor.set_injected_text(InjectionOwner::InlayHint, vec![hint]);+ editor.set_selections(vec![crate::editor::Selection::caret(Position::new(0, 2))]);+ editor.click_past_injections(0, 4.6);+ assert_eq!(editor.head_past_injections(0), 1, "the click lands after the hint");+ // Shift+Right from "a|b" stops after the hint, so the selection of `b` covers it.+ editor.set_selections(vec![crate::editor::Selection::caret(Position::new(0, 1))]);+ editor.move_horizontally(true, true);+ assert_eq!(editor.selection_x(0, &editor.line_layout(0), 0, 1, 2), (1., 5.));+}+/// `normalizeOffsetInInputWithInjectionsAroundInjections` with `PositionAffinity.None`.#[test]fn a_cursor_rests_at_the_injections_stops() {diff --git a/native/crates/app/src/workbench/editor_view.rs b/native/crates/app/src/workbench/editor_view.rsindex eb3b225426e..d1636afa840 100644--- a/native/crates/app/src/workbench/editor_view.rs+++ b/native/crates/app/src/workbench/editor_view.rs@@ -1734,7 +1734,7 @@ impl Workbench {let view_line_count = editor.view_line_count();// viewLines.ts linesVisibleRangesForRange: a selected line break is one typicalHalfwidthCharacterWidth wide.// With word wrap each view line gets the part of the selection on its segment, in the view line's x.- let selection_range = |selection: Selection, view_line: usize| {+ let selection_range = |index: usize, selection: Selection, view_line: usize| {let segment = editor.segment(view_line);let text = &editor.document().lines[segment.line];let (start, end, line_break) = selected_columns(selection, segment.line, text)?;@@ -1744,7 +1744,7 @@ impl Workbench {return None;}let layout = editor.line_layout(segment.line);- let (left, right) = layout.range(start, end);+ let (left, right) = editor.selection_x(index, &layout, segment.line, start, end);let segment_left = segment.indent as f32 - segment.start_x(&layout);Some(((segment_left + left) * char_width, (segment_left + right) * char_width + if line_break { char_width } else { 0. }))};@@ -1787,11 +1787,11 @@ impl Workbench {// selections.ts: inner corner pieces of every selection go before the rest (issue #77777).let mut inner_corners = Vec::new();let mut pieces = Vec::new();- for selection in selections {+ for (index, selection) in selections.iter().enumerate() {let in_line_x = |(left, right): (f32, f32)| (left + shift, right + shift);- let Some((left, right)) = selection_range(*selection, view_line).map(in_line_x) else { continue };- let above = view_line.checked_sub(1).and_then(|above| selection_range(*selection, above)).map(in_line_x);- let below = if view_line + 1 < view_line_count { selection_range(*selection, view_line + 1).map(in_line_x) } else { None };+ let Some((left, right)) = selection_range(index, *selection, view_line).map(in_line_x) else { continue };+ let above = view_line.checked_sub(1).and_then(|above| selection_range(index, *selection, above)).map(in_line_x);+ let below = if view_line + 1 < view_line_count { selection_range(index, *selection, view_line + 1).map(in_line_x) } else { None };// `hasMultipleSelections` insets the first line by 1px at the top, the last (not also first) at the bottom.let multiple = selections.len() > 1;let top = if multiple && above.is_none() { 1. } else { 0. };@@ -2056,8 +2056,9 @@ impl Workbench {}let segment_columns = (segment.start_x(&layout), if segment.last { f32::MAX } else { segment.end_x(&layout) });// The click handlers take the model text's visible column; the injected text's x is left out here.+ let layout_x_at = move |workbench: &Workbench, x: gpui::Pixels| ((f32::from(x) - workbench.text_area_left.get() - metrics.content_left() + scroll_left + shift) / char_width).clamp(segment_columns.0, segment_columns.1);let visible_at = move |workbench: &Workbench, x: gpui::Pixels| {- let x = ((f32::from(x) - workbench.text_area_left.get() - metrics.content_left() + scroll_left + shift) / char_width).clamp(segment_columns.0, segment_columns.1);+ let x = layout_x_at(workbench, x);workbench.editors.active().map_or(x, |editor| editor.line_layout(index).model_visible(x))};let content = div()@@ -2083,6 +2084,10 @@ impl Workbench {workbench.selecting_text = Some(MouseDown { count: event.click_count, on_gutter: false });workbench.fold_mouse_down = workbench.at_line_end(index, visible).then_some((index, false));workbench.click_text(index, visible, modifiers, modifiers.shift, event.click_count, cx);+ let layout_x = layout_x_at(workbench, event.position.x);+ if let Some(editor) = workbench.editors.active_mut().filter(|_| event.click_count == 1) {+ editor.click_past_injections(index, layout_x);+ }workbench.keep_click_at_row_end(view_line, visible);workbench.show_long_line(index, visible, char_width, cx);}))diff --git a/port/ledger.md b/port/ledger.mdindex a286f490772..c0c7008bbd3 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -315,7 +315,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| editor/contrib/hover | src/vs/editor/contrib | M13 | verified | | workbench/content_hover.rs (contentHoverController, hoverOperation timing, markdown/marker/unicode participants, sticky, mouse-getting-closer, `editor.hover.*` settings, showHover/hideHover, Show or Focus Hover with its `focus` argument, `editorHoverVisible`, `editorHoverFocused`: Escape hides the focused hover and focuses the editor, a focused hover stays through mouse moves and leaves, a click in the text hides it; focusable parts with Tab through them and the links, verbosity actions, copy buttons and status bar actions inside them, which Enter or Space activates, `focusedHoverPartIndex` for the verbosity actions, the scroll, page and top/bottom hover actions; hoverAccessibleViews.ts in workbench/accessible_view.rs: Alt+F2 reads the focused part or the whole hover with the part's verbosity actions in the toolbar, Alt+F1 lists them before the part, the view follows the hover's contents and keeps it open, Escape focuses the part again, and a shown workbench hover is read in its place), workbench/content_hover_view.rs (widget placement as `_layoutBoxInPage`, max size, rows, copy button with its "Copied to clipboard" status, marker status bar with View Problem, resize sashes with `_lastDimensions`, the verbosity + and - of a provider's hover with Increase/Decrease Hover Verbosity Level and `verbosityRequest`): cargo test -p app content_hover; ui-pair hover on src/main.ts. The color picker part is workbench/color_picker.rs, the inlay hint tooltip comes from workbench/inlay_hints.rs || editor/contrib/inPlaceReplace | src/vs/editor/contrib | M8 | verified | | Replace with Previous/Next Value (Shift+Cmd+, and ., palette): number step and value sets of `navigateValueSet`, 350 ms outline in light themes; cargo test -p app editor::in_place_replace (upstream has no test); ui-pair light theme `x = true; y = 41; z = 1.5` from the palette || editor/contrib/indentation | src/vs/editor/contrib | M8 | verified | [scheduling L] minimap.rs:87; minimap_view.rs:432; unicode_highlight.rs:63; indentation.rs:43; comment.rs:45; smart_select.rs:292: sticky minimap sampling, worker section headers and unicode highlights, tokenizeIfCheap, the 30 ms smart select yield. Accepted as "Scheduling differences" only with a measured same result and typing on a 50k-line TS file under 16 ms per edit; otherwise class 3. Audit inputs at 5e5b1b0a915. | indentation.ts actions (indent using spaces/tabs, tab display size, detect, convert to spaces/tabs) and trimTrailingWhitespaceCommand.ts with their upstream tests, auto-indent on Enter and on type (`editor.autoIndent`), Reindent Lines and Reindent Selected Lines: cargo test -p app indentation editor_status editor::auto_indent (cursor.test.ts indent cases, Auto Indent On Type - TypeScript/JavaScript, shiftCommand.test.ts doc block cases); auto-indent on paste (`editor.autoIndentOnPaste`, `autoIndentOnPasteWithinString`, `AutoIndentOnPaste.trigger`) and the Ruby, PHP and Visual Basic suites of indentation.test.ts pass; the cases upstream skips (`test.skip`: paste 5, Ruby, Go, CPP 3, HTML, Latex, Lua) are `#[ignore]` and fail as upstream (cargo test -p app auto_indent, 115 passed, 13 ignored); indentation.ts actions (indent using spaces/tabs, tab display size, detect, convert to spaces/tabs) and trimTrailingWhitespaceCommand.ts with their upstream tests, auto-indent on Enter and on type (`editor.autoIndent`), Reindent Lines and Reindent Selected Lines: cargo test -p app indentation editor_status editor::auto_indent (cursor.test.ts indent cases, Auto Indent On Type - TypeScript/JavaScript, shiftCommand.test.ts doc block cases); no auto-indent on paste (`editor.autoIndentOnPaste`, default off), not the Ruby, PHP, Go, CPP, HTML, Visual Basic, Latex and Lua suites |-| editor/contrib/inlayHints | src/vs/editor/contrib | M13 | ported | [3 M] cursor.rs:133: vertical moves count no injected chars in the visible columns <br> [3 S] injected_text.rs:191: a click past the middle of a hint's last char lands before the hint, upstream after it <br> [3 S] injected_text.rs:175: a selection whose head sits after a hint at its end is drawn ending before the hint | workbench/inlay_hints.rs over editor/injected_text.rs (the 'InlayHint' debounce: inlay_hints::tests::the_delay_follows_the_providers_answer_time; off a word a hint attaches after its token's start, `_getRangeAtPosition`: inlay_hints::tests::a_hint_off_a_word_attaches_after_the_start_of_its_token; inlayHintsController.ts: cache, fixed lengths while typing, label parts, links, tooltip resolve, double click edits, `editor.inlayHints.*`, `_executeInlayHintProvider`): cargo test -p app injected_text inlay_hints; ui-pair port/fixtures/language-features/steps-color.json (port/results/inlay-hints.md) |+| editor/contrib/inlayHints | src/vs/editor/contrib | M13 | verified | | workbench/inlay_hints.rs over editor/injected_text.rs (the 'InlayHint' debounce: inlay_hints::tests::the_delay_follows_the_providers_answer_time; off a word a hint attaches after its token's start, `_getRangeAtPosition`: inlay_hints::tests::a_hint_off_a_word_attaches_after_the_start_of_its_token; inlayHintsController.ts: cache, fixed lengths while typing, label parts, links, tooltip resolve, double click edits, `editor.inlayHints.*`, `_executeInlayHintProvider`): cargo test -p app injected_text inlay_hints; ui-pair port/fixtures/language-features/steps-color.json (port/results/inlay-hints.md) || editor/contrib/inlineCompletions | src/vs/editor/contrib | M13 | verified | | workbench/inline_completions.rs, ghost_text.rs (computeGhostText.ts over diff::lcs_diff), the suggest widget adaptor in workbench/suggest_controller.rs and workbench/suggest_widget.rs: cargo test -p app ghost_text inline_completions (computeGhostText.test.ts cases, getSecondaryEdits.test.ts, inlineCompletions.test.ts: the "Inline Completions" suite with its Forward Stability tests, the Multi Cursor Support suite and both "Change hint" tests; suggestWidgetModel.test.ts "Ghost Text" and "offWhenInlineCompletions", the augmentation over the suggest widget's own list (only_the_answer_with_the_suggest_item_augments_it), the inline preselect of the suggest widget, Shift previewing the replace edit and handleSuggestAccepted), cargo test -p diff lcs_diff (diff.test.ts and upstream outputs); ui-pair port/fixtures/language-features/steps-ghost.json (port/results/inlay-hints.md). Not ported by design: "Emits empty response telemetry after instantiation service disposal" (the port has no telemetry), suggestWidgetModel.test.ts "Active" (test.skip upstream, microsoft/vscode#166023), ghostTextView/layout/scrollToReveal tests (DOM, the ui-pair check stands in). Inline edits, next edit suggestions and their tests (inlineEdits, editKind, longDistanceWidgetPlacement, renameSymbolProcessor, graph) are AI: removed. Items dedupe and select by `semanticId`: cargo test -p app items_with_the_same_trimmed_edit_cycle_as_one. `getDefaultRange` from the word start to the line end: cargo test -p app an_item_without_a_range_replaces_up_to_the_line_end. || editor/contrib/inlineProgress | src/vs/editor/contrib | M13 | verified | | workbench/inline_progress.rs (inlineProgress.ts): the spinner after 500 ms at the paste or drop position with 1em of room as injected text, its hover, click cancels; the paste falls back to the default paste: cargo test -p app paste_edits (the_paste_progress_makes_room_for_its_spinner); ui-pair d.md paste (no spinner once the provider answers, as in the reference) || editor/contrib/insertFinalNewLine | src/vs/editor/contrib | M8 | verified | | `OpenEditor::insert_final_new_line` in `editor/indentation.rs`, `editor.action.insertFinalNewLine` (writable): cargo test -p app insert_final_new_line; ui-pair notes.txt through the Command Palette |