Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(editor): a padded inlay hint split by word wrap pads each piece

rokartur3808a535b82d
diff --git a/README.md b/README.md
index e18e37a8bee..e775651ffee 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
```mermaid
pie showData
- "verified" : 417
- "ported" : 13
+ "verified" : 418
+ "ported" : 12
"removed" : 126
"n/a" : 28
```
@@ -28,10 +28,10 @@ pie showData
| 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/editor | 1 | 1 | 1 | 1 | `██████████░░░░░░░░░░ 50%` |
| src/vs/base | 0 | 0 | 2 | 3 | `████████████████████ 100%` |
| port feature | 1 | 0 | 0 | 0 | `████████████████████ 100%` |
-| **all** | **417** | **13** | **126** | **28** | `███████████████████░ 97%` |
+| **all** | **418** | **12** | **126** | **28** | `███████████████████░ 97%` |
<!-- 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/injected_text.rs b/native/crates/app/src/editor/injected_text.rs
index 2401f8c84bc..d773a3a76ef 100644
--- a/native/crates/app/src/editor/injected_text.rs
+++ b/native/crates/app/src/editor/injected_text.rs
@@ -88,8 +88,21 @@ pub enum WrapWidth {
Fixed,
/// An inlay hint: its label chars between its `paddingLeft` and `paddingRight` whitespace (width-only
/// injections) of these columns; the `editor.inlayHints.padding` box (`padding` columns each side) and font size
- /// do not count.
- Hint { left: f32, right: f32, padding: f32 },
+ /// do not count. The box's left side is on the first label part (its chars end at `first_part_end`), its right
+ /// side on the last (from `last_part_start`).
+ Hint { left: f32, right: f32, padding: f32, first_part_end: usize, last_part_start: usize },
+}
+
+impl WrapWidth {
+ /// A wrap before label char `index` of a hint cuts its part's span in two, and each piece takes the part's
+ /// padding (inlayHintsController.ts `cssProperties.padding`): the right side added to the piece before the wrap
+ /// and the left side to the piece after it, in columns.
+ pub fn hint_split_padding(&self, index: usize) -> (f32, f32) {
+ let WrapWidth::Hint { padding, first_part_end, last_part_start, .. } = *self else { return (0., 0.) };
+ let right = if index > last_part_start { padding } else { 0. };
+ let left = if index < first_part_end { padding } else { 0. };
+ (right, left)
+ }
}
/// One injected text before the char at `position` (after the line's last char at its length).
@@ -287,7 +300,15 @@ impl OpenEditor {
/// The x of every column of model line `line`.
pub fn line_layout(&self, line: usize) -> LineLayout {
let document = self.document();
- LineLayout::new(&document.lines[line], document.indentation.tab_size, self.injected_text_on(line).iter().map(|injection| (injection.position.column, injection.columns, injection.content.as_str())))
+ let splits = self.hint_splits(line);
+ let columns = |index: usize, injection: &InjectedText| {
+ let split_padding = |(_, char): &(usize, usize)| -> f32 {
+ let (right, left) = injection.wrap.hint_split_padding(*char);
+ right + left
+ };
+ injection.columns + splits.iter().filter(|(split, _)| *split == index).map(split_padding).sum::<f32>()
+ };
+ LineLayout::new(&document.lines[line], document.indentation.tab_size, self.injected_text_on(line).iter().enumerate().map(|(index, injection)| (injection.position.column, columns(index, injection), injection.content.as_str())))
}
/// `changeDecorations` of one owner's injected text: replaces what it injected before; the lines with
diff --git a/native/crates/app/src/editor/injected_text/tests.rs b/native/crates/app/src/editor/injected_text/tests.rs
index 49c035468ba..553a2b99457 100644
--- a/native/crates/app/src/editor/injected_text/tests.rs
+++ b/native/crates/app/src/editor/injected_text/tests.rs
@@ -157,12 +157,18 @@ fn wrapping_counts_the_injected_width_and_breaks_before_it() {
/// monospaceLineBreaksComputer.ts measures a hint's label chars and its `paddingLeft` whitespace, not its padding
/// box: "ab |_[cccc |dddd]_|xy" breaks inside the hint before `dddd`, past the whitespace, the box's left side and 5
-/// label chars, as the hint draws them.
+/// label chars. Each view line's span of the label draws its own box (inlayHintsController.ts `cssProperties.padding`
+/// on the label's class), so the first ends past its right side too.
#[test]
fn wrapping_a_padded_inlay_hint_skips_its_padding_box() {
let classifier = Classifier::new(BREAK_BEFORE, BREAK_AFTER);
- let hint = injection(3, 13., "cccc dddd", WrapWidth::Hint { left: 1., right: 1., padding: 1. });
- let breaks = line_breaks(&classifier, "ab xy", &wrap_options(), &[hint]).unwrap();
+ let hint = |first_part_end, last_part_start| injection(3, 13., "cccc dddd", WrapWidth::Hint { left: 1., right: 1., padding: 1., first_part_end, last_part_start });
+ let breaks = line_breaks(&classifier, "ab xy", &wrap_options(), &[hint(9, 0)]).unwrap();
assert_eq!(breaks.offsets, [3, 5]);
+ assert!((breaks.injected[0] - 8.).abs() < 1e-4, "{:?}", breaks.injected);
+ assert_eq!(breaks.hint_splits, [(0, 5)]);
+ // Label parts "cccc " and "dddd": the wrap between them cuts no span.
+ let breaks = line_breaks(&classifier, "ab xy", &wrap_options(), &[hint(5, 5)]).unwrap();
assert!((breaks.injected[0] - 7.).abs() < 1e-4, "{:?}", breaks.injected);
+ assert_eq!(breaks.hint_splits, []);
}
diff --git a/native/crates/app/src/editor/word_wrap.rs b/native/crates/app/src/editor/word_wrap.rs
index d1c2c52b2f4..d5e65fc560b 100644
--- a/native/crates/app/src/editor/word_wrap.rs
+++ b/native/crates/app/src/editor/word_wrap.rs
@@ -95,13 +95,16 @@ impl Classifier {
/// `ModelLineProjectionData`: where each view line ends (the last one at the line's length) as a char column and the
/// drawn width of the injected text at that column still on the view line, their visible columns with the injected
-/// text before them, and the indent of every view line after the first.
+/// text before them, and the indent of every view line after the first. `hint_splits` are the breaks inside a padded
+/// inlay hint label part, as (the injection's index on the line, the label char after the break): each piece draws
+/// the part's padding, so the hint is wider by `WrapWidth::hint_split_padding` per split.
#[derive(Clone, Debug, PartialEq)]
pub struct LineBreaks {
pub offsets: Vec<usize>,
pub injected: Vec<f32>,
pub visible_columns: Vec<f64>,
pub wrapped_indent: usize,
+ pub hint_splits: Vec<(usize, usize)>,
}
impl LineBreaks {
@@ -130,26 +133,29 @@ struct Unit<'a> {
drawn: Option<f64>,
/// The drawn width of the injected units at `column` before this one.
injected_before: f64,
+ /// A hint's label char after its first: the injection's index on the line, the char's index, and the padding a
+ /// wrap before it adds to the piece before and the piece after (`WrapWidth::hint_split_padding`).
+ hint_char: Option<(usize, usize, f64, f64)>,
}
/// `text` with `injections` (by column) applied, as units. An injection's chars share its text width evenly, as a
/// monospace font draws them at any size.
fn line_units<'a>(text: &str, injections: &'a [InjectedText]) -> Vec<Unit<'a>> {
let mut units = Vec::new();
- let mut pending = injections.iter().peekable();
+ let mut pending = injections.iter().enumerate().peekable();
for (column, c) in text.chars().map(Some).chain([None]).enumerate() {
let mut injected_before = 0.;
let mut push = |units: &mut Vec<Unit<'a>>, c, fixed, wrap_width, drawn: f64| {
- units.push(Unit { column, c, fixed, wrap_width, drawn: Some(drawn), injected_before });
+ units.push(Unit { column, c, fixed, wrap_width, drawn: Some(drawn), injected_before, hint_char: None });
injected_before += drawn;
};
- while let Some(injection) = pending.next_if(|injection| injection.position.column == column) {
+ while let Some((injection_index, injection)) = pending.next_if(|(_, injection)| injection.position.column == column) {
let (columns, chars) = (injection.columns as f64, injection.content.chars().count());
match injection.wrap {
WrapWidth::Fixed => push(&mut units, None, injection.content.as_str(), Some(columns), columns),
WrapWidth::Chars if chars == 0 => push(&mut units, None, "", Some(0.), columns),
WrapWidth::Chars => injection.content.chars().for_each(|c| push(&mut units, Some(c), "", None, columns / chars as f64)),
- WrapWidth::Hint { left, right, padding } => {
+ WrapWidth::Hint { left, right, padding, .. } => {
let (left, right, padding) = (left as f64, right as f64, padding as f64);
if left > 0. {
push(&mut units, None, "", Some(left), left);
@@ -160,6 +166,10 @@ fn line_units<'a>(text: &str, injections: &'a [InjectedText]) -> Vec<Unit<'a>> {
let first = if index == 0 { padding } else { 0. };
let last = if index + 1 == chars { padding } else { 0. };
push(&mut units, Some(c), "", None, first + share + last);
+ let (split_right, split_left) = injection.wrap.hint_split_padding(index);
+ if index > 0 && split_right + split_left > 0. {
+ units.last_mut().expect("pushed above").hint_char = Some((injection_index, index, split_right as f64, split_left as f64));
+ }
}
if right > 0. {
push(&mut units, None, "", Some(right), right);
@@ -168,7 +178,7 @@ fn line_units<'a>(text: &str, injections: &'a [InjectedText]) -> Vec<Unit<'a>> {
}
}
if c.is_some() {
- units.push(Unit { column, c, fixed: "", wrap_width: None, drawn: None, injected_before });
+ units.push(Unit { column, c, fixed: "", wrap_width: None, drawn: None, injected_before, hint_char: None });
}
}
units
@@ -256,12 +266,24 @@ pub fn line_breaks(classifier: &Classifier, text: &str, options: &WrapOptions, i
if breaks.is_empty() {
return None;
}
- let (mut offsets, mut injected): (Vec<usize>, Vec<f32>) = breaks.iter().map(|&i| (units[i].column, units[i].injected_before as f32)).unzip();
+ let splits: Vec<usize> = breaks.iter().copied().filter(|&i| units[i].hint_char.is_some()).collect();
+ // The padding the splits at `column` before unit `end` add.
+ let split_padding = |end: usize, column: usize| -> f64 {
+ splits.iter().filter(|&&i| i < end && units[i].column == column).map(|&i| units[i].hint_char.map_or(0., |(_, _, right, left)| right + left)).sum()
+ };
+ let mut offsets = Vec::new();
+ let mut injected = Vec::new();
+ for &i in &breaks {
+ let own_right_side = units[i].hint_char.map_or(0., |(_, _, right, _)| right);
+ offsets.push(units[i].column);
+ injected.push((units[i].injected_before + split_padding(i, units[i].column) + own_right_side) as f32);
+ }
let trailing: f64 = units.iter().filter(|unit| unit.column == model_chars.len()).filter_map(|unit| unit.drawn).sum();
offsets.push(model_chars.len());
- injected.push(trailing as f32);
+ injected.push((trailing + split_padding(units.len(), model_chars.len())) as f32);
visible_columns.push(visible);
- Some(LineBreaks { offsets, injected, visible_columns, wrapped_indent })
+ let hint_splits = splits.iter().map(|&i| units[i].hint_char.map(|(injection, char, ..)| (injection, char)).expect("a split")).collect();
+ Some(LineBreaks { offsets, injected, visible_columns, wrapped_indent, hint_splits })
}
/// The injected texts on `line`, from all of them by position.
@@ -477,6 +499,14 @@ impl OpenEditor {
}
}
+ /// `LineBreaks::hint_splits` of model line `line` while it wraps.
+ pub fn hint_splits(&self, line: usize) -> &[(usize, usize)] {
+ if !self.wraps() {
+ return &[];
+ }
+ self.word_wrap.breaks[line].as_ref().map_or(&[], |breaks| &breaks.hint_splits)
+ }
+
/// The model line and chars that view line `view_line` shows.
pub fn segment(&self, view_line: usize) -> Segment {
let line = self.model_line(view_line);
diff --git a/native/crates/app/src/workbench/editor_view/injected_text_view.rs b/native/crates/app/src/workbench/editor_view/injected_text_view.rs
index 3da25137a01..a93430e6404 100644
--- a/native/crates/app/src/workbench/editor_view/injected_text_view.rs
+++ b/native/crates/app/src/workbench/editor_view/injected_text_view.rs
@@ -55,12 +55,16 @@ impl Workbench {
/// Each injected text of model line `line`, drawn by its owner at its x.
pub(super) fn injected_text_elements(&self, editor: &OpenEditor, line: usize, layout: &LineLayout, metrics: &EditorMetrics, cx: &mut Context<Self>) -> Vec<AnyElement> {
let injections = editor.injected_text_on(line);
+ let hint_splits = editor.hint_splits(line);
let mut elements = Vec::new();
for (index, x) in layout.injection_x() {
let injection = &injections[index];
let left = x * metrics.char_width;
let element = match injection.owner {
- InjectionOwner::InlayHint => self.inlay_hint_element(editor, injection.id, left, metrics.line_height, cx),
+ InjectionOwner::InlayHint => {
+ let splits: Vec<usize> = hint_splits.iter().filter(|(split, _)| *split == index).map(|(_, char)| *char).collect();
+ self.inlay_hint_element(editor, injection.id, &splits, left, metrics.line_height, cx)
+ }
InjectionOwner::Color => self.color_decorator_element(editor, injection.id, left, metrics.line_height, cx),
InjectionOwner::GhostText => self.ghost_text_element(injection.id, left, metrics.line_height),
InjectionOwner::DecorationContent => self.decoration_content_element(editor, injection.id, left, metrics.line_height),
diff --git a/native/crates/app/src/workbench/inlay_hints.rs b/native/crates/app/src/workbench/inlay_hints.rs
index d7eb90db5d0..d2705201d13 100644
--- a/native/crates/app/src/workbench/inlay_hints.rs
+++ b/native/crates/app/src/workbench/inlay_hints.rs
@@ -352,7 +352,9 @@ impl Workbench {
let columns = chars as f32 * layout.font_size / layout.editor_font_size + px_columns(self.inlay_hint_padding_px(&item.hint, &layout));
let whitespace = |side: &str| if item.hint[side] == json!(true) { px_columns((layout.font_size / 3.).floor()) } else { 0. };
let padding = if layout.padding { px_columns((layout.font_size / 4.).floor().max(1.)) } else { 0. };
- let wrap = WrapWidth::Hint { left: whitespace("paddingLeft"), right: whitespace("paddingRight"), padding };
+ let part_chars = |part: Option<&RenderedPart>| part.map_or(0, |part| part.text.chars().count());
+ let (first_part_end, last_part_start) = (part_chars(parts.first()), chars - part_chars(parts.last()));
+ let wrap = WrapWidth::Hint { left: whitespace("paddingLeft"), right: whitespace("paddingRight"), padding, first_part_end, last_part_start };
let content = parts.iter().map(|part| part.text.as_str()).collect();
injections.push(InjectedText { position: item.position, columns, content, wrap, owner: InjectionOwner::InlayHint, id, at_range_start: !item.after });
rendered.insert(id, parts);
@@ -436,8 +438,9 @@ impl Workbench {
}
/// The hint `id` drawn in the gap its injected text leaves: each label part a span in the hint font with the
- /// kind's colors, the active part underlined, a link under the trigger modifier.
- pub(super) fn inlay_hint_element(&self, editor: &OpenEditor, id: usize, left: f32, line_height: f32, cx: &mut Context<Self>) -> Option<AnyElement> {
+ /// kind's colors, the active part underlined, a link under the trigger modifier. `splits` are the label chars
+ /// the word wrap breaks before.
+ pub(super) fn inlay_hint_element(&self, editor: &OpenEditor, id: usize, splits: &[usize], left: f32, line_height: f32, cx: &mut Context<Self>) -> Option<AnyElement> {
let item = self.inlay_hints.items.get(id)?;
let parts = self.inlay_hints.rendered.get(&id)?;
let layout = self.inlay_hint_layout(editor);
@@ -461,32 +464,41 @@ impl Workbench {
row = row.child(div().w(px(whitespace)).flex_none());
}
let count = parts.len();
+ let mut part_start = 0;
for (position, part) in parts.iter().enumerate() {
let label_part = label_part(hint, part.index);
let is_link = !label_part["command"].is_null() || !label_part["location"].is_null();
let active = is_link && self.inlay_hints.active_part == Some((id, part.index));
- let mut span = div()
- .id(("inlay-hint", id * 1000 + part.index))
- .h_full()
- .flex()
- .items_center()
- .font_family(layout.family.clone())
- .text_size(px(layout.font_size))
- .text_color(if active && link_modifier { active_link } else { foreground })
- .when_some(background, |span, background| span.bg(background))
- .when(active, |span| span.underline())
- .when(has_edits, |span| span.cursor_default())
- .when(active && link_modifier, |span| span.cursor_pointer())
- .child(part.text.clone());
- if layout.padding {
- let (first, last) = (position == 0, position + 1 == count);
- span = span.when(first, |span| span.pl(px(side_padding)).rounded_l(px(radius))).when(last, |span| span.pr(px(side_padding)).rounded_r(px(radius)));
+ // A wrap inside the part cuts its span in two, each with the part's padding (`hint_split_padding`).
+ let chars: Vec<char> = part.text.chars().collect();
+ let mut cuts: Vec<usize> = splits.iter().filter(|&&split| split > part_start && split < part_start + chars.len()).map(|split| split - part_start).collect();
+ cuts.insert(0, 0);
+ cuts.push(chars.len());
+ part_start += chars.len();
+ for (piece, range) in cuts.windows(2).enumerate() {
+ let mut span = div()
+ .id(("inlay-hint", (id * 1000 + part.index) * 100 + piece))
+ .h_full()
+ .flex()
+ .items_center()
+ .font_family(layout.family.clone())
+ .text_size(px(layout.font_size))
+ .text_color(if active && link_modifier { active_link } else { foreground })
+ .when_some(background, |span, background| span.bg(background))
+ .when(active, |span| span.underline())
+ .when(has_edits, |span| span.cursor_default())
+ .when(active && link_modifier, |span| span.cursor_pointer())
+ .child(chars[range[0]..range[1]].iter().collect::<String>());
+ if layout.padding {
+ let (first, last) = (position == 0, position + 1 == count);
+ span = span.when(first, |span| span.pl(px(side_padding)).rounded_l(px(radius))).when(last, |span| span.pr(px(side_padding)).rounded_r(px(radius)));
+ }
+ let part_index = part.index;
+ span = span
+ .on_hover(cx.listener(move |workbench, hovered: &bool, _, cx| workbench.inlay_hint_part_hovered(id, part_index, *hovered, cx)))
+ .on_mouse_down(MouseButton::Left, cx.listener(move |workbench, event: &MouseDownEvent, window, cx| workbench.inlay_hint_part_clicked(id, part_index, event, window, cx)));
+ row = row.child(span);
}
- let part_index = part.index;
- span = span
- .on_hover(cx.listener(move |workbench, hovered: &bool, _, cx| workbench.inlay_hint_part_hovered(id, part_index, *hovered, cx)))
- .on_mouse_down(MouseButton::Left, cx.listener(move |workbench, event: &MouseDownEvent, window, cx| workbench.inlay_hint_part_clicked(id, part_index, event, window, cx)));
- row = row.child(span);
}
if hint["paddingRight"] == json!(true) {
row = row.child(div().w(px(whitespace)).flex_none());
diff --git a/port/fixtures/extensions/messages/extension.js b/port/fixtures/extensions/messages/extension.js
index c9c942869e2..8a88b402f53 100644
--- a/port/fixtures/extensions/messages/extension.js
+++ b/port/fixtures/extensions/messages/extension.js
@@ -35,6 +35,11 @@ const shows = {
},
openDialog: () => vscode.window.showOpenDialog({ canSelectMany: true, openLabel: 'Pick Files', filters: { 'JSON': ['json'] } }),
saveDialog: () => vscode.window.showSaveDialog({ saveLabel: 'Store', title: 'Save from an extension' }),
+ inlayHints: async () => {
+ vscode.languages.registerInlayHintsProvider({ pattern: '**/notes.txt' }, {
+ provideInlayHints: () => [Object.assign(new vscode.InlayHint(new vscode.Position(0, 10), 'a long hint label that wraps', vscode.InlayHintKind.Parameter), { paddingLeft: true, paddingRight: true })],
+ });
+ },
decorations: async () => {
vscode.window.registerFileDecorationProvider({
provideFileDecoration: uri => uri.path.endsWith('.json') ? { badge: 'P', tooltip: 'Port decoration', color: new vscode.ThemeColor('charts.red'), propagate: true } : undefined,
diff --git a/port/fixtures/extensions/messages/package.json b/port/fixtures/extensions/messages/package.json
index 152339c0d7a..fdd6995c280 100644
--- a/port/fixtures/extensions/messages/package.json
+++ b/port/fixtures/extensions/messages/package.json
@@ -19,7 +19,8 @@
{ "command": "portMessages.status", "title": "Port Messages: Status" },
{ "command": "portMessages.openDialog", "title": "Port Messages: Open Dialog" },
{ "command": "portMessages.saveDialog", "title": "Port Messages: Save Dialog" },
- { "command": "portMessages.decorations", "title": "Port Messages: Decorations" }
+ { "command": "portMessages.decorations", "title": "Port Messages: Decorations" },
+ { "command": "portMessages.inlayHints", "title": "Port Messages: Inlay Hints" }
]
}
}
diff --git a/port/fixtures/ui-pair/m8/inlay-hint-wrap.json b/port/fixtures/ui-pair/m8/inlay-hint-wrap.json
new file mode 100644
index 00000000000..fba996e1296
--- /dev/null
+++ b/port/fixtures/ui-pair/m8/inlay-hint-wrap.json
@@ -0,0 +1 @@
+[{"wait":6000},{"shot":"wrapped"}]
diff --git a/port/ledger.md b/port/ledger.md
index 6c11846cfbb..e3f770f6188 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -285,7 +285,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| platform/windows | src/vs/platform | M11 | verified | | windows_state.rs (windowsStateHandler.ts, windowsMainService.ts `doGetPathsFromLastSession`): `windowsState` in `User/globalStorage/storage.json` saved on quit (the last window closed, else the active one; all windows when two or more), restored on a start without paths and on every start with `preserve` (`window.restoreWindows` none, one, folders, all), each window in its display and bounds when that display is still there, fullscreen only with `window.restoreFullscreen`; empty windows reopen on their backup folder; a reload keeps the window's place; a new window takes the stored place of its workspace, folder or empty window, the first one the last active window's, else `window.newWindowDimensions` (default and offset cascade 30 points off the open windows, inherit, maximized, fullscreen). The default size stays 1024x768, the reference capture size of port/tools/ref-screenshot, where upstream takes 1200x800 or 1440x900. `cargo test -p app windows_state`; verified: ui-pair hot-exit.json `restored` vs the reference (port/results/windows.md, milestone 11 verification): the window restored on its folder after quit |
| platform/workspace | src/vs/platform | M12 | verified | | virtual workspaces (non-file folders): milestone 25; config/src/workspace.rs: folders, getFolder, toWorkspaceFolders, workspace label; cargo test -p config workspace (workspace.test.ts cases); api-workspace 4/4; verified: api-tests MOCHA_GREP="vscode API - (workspace|file system|env|types|tasks)" at 44a309311e1: every workspace, workspace-fs, workspace events, workspace-watcher and file system test passes, api-workspace 4/0/0 (port/results/api-tests.md "M12 verification"), api-workspace 4/4 |
| platform/workspaces | src/vs/platform | M12 | verified | | getWorkspaceIdentifier and getSingleFolderWorkspaceIdentifier (session.rs, workspaces.test.ts stable id case, cargo test -p exthost); recently opened list (recently_opened.rs, workspacesHistoryMainService: `history.recentlyOpenedPathsList` in shared storage, 500 per kind, cargo test -p app recently_opened); untitled workspaces under `<user data>/Workspaces/<id>/workspace.json` (config/src/workspace.rs isUntitledWorkspace, workbench/workspace_editing.rs createUntitledWorkspace, deleteUntitledWorkspace, Save Workspace As with rewritten relative paths): cargo test -p config workspace:: 5/5, cargo test -p app workspace_editing; ui-pair port/fixtures/ui-pair/m12/workspace-folders.json (Remove Folder from Workspace enters Untitled (Workspace)), verified at port-m12b-verify; getWorkspaceIdentifier and getSingleFolderWorkspaceIdentifier (session.rs, workspaces.test.ts stable id case, cargo test -p exthost); no untitled workspaces or recent list; getWorkspaceIdentifier and getSingleFolderWorkspaceIdentifier (session.rs, workspaces.test.ts stable id case, cargo test -p exthost); recently opened list (recently_opened.rs, workspacesHistoryMainService: `history.recentlyOpenedPathsList` in shared storage, 500 per kind, cargo test -p app recently_opened); no untitled workspaces; getWorkspaceIdentifier and getSingleFolderWorkspaceIdentifier (session.rs, workspaces.test.ts stable id case, cargo test -p exthost); no untitled workspaces or recent list |
-| editor/browser | src/vs/editor | M8 | ported | [3 S] word_wrap.rs:157: an inlay hint with `editor.inlayHints.padding` broken by word wrap draws one padding box around both pieces, upstream's split spans each draw their own <br> [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. | scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests (8); folding (editor/folding.rs): cargo test -p app editor::folding (49); minimap with slider, decorations, section headers, settings and the scrollbar context menu (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap (11), section_headers (18), editor_menus (8); sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`): cargo test -p app selection_corners (1); `editor.renderWhitespace` (editor/whitespace.rs): cargo test -p app whitespace (39); control characters and bidi format characters as `[U+XXXX]` (workbench/control_characters.rs): cargo test -p app control_characters (4); glyph margin and line number presses (workbench/gutter_mouse.rs): cargo test -p app gutter_presses (1); word wrap with view lines, Toggle Word Wrap and the wrap indicator (editor/word_wrap.rs): cargo test -p app word_wrap (21), ui-pair /tmp/m8wrap wrap.ts; `editor.smoothScrolling` (editor/smooth_scroll.rs, workbench/smooth_scrolling.rs): cargo test -p app smooth_scroll (11, the scrollable.test.ts cases); diff editor widget (port/notes.md milestone 14): cargo test -p app diff_editor (22), diff_gutter (2); all run at the milestone 20 sweep; scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; `editor.renderWhitespace` marks drawn as svg circles and arrows (editor/whitespace.rs, viewParts/whitespace): cargo test -p app whitespace, ui-pair notes.txt; control characters as Control Pictures (`editor.renderControlCharacters`, workbench/control_characters.rs): cargo test -p app control_characters; glyph margin and line number presses select lines, drags extend them, Alt adds a line cursor (mouseHandler.ts `startedOnLineNumbers`, workbench/gutter_mouse.rs): cargo test -p app gutter_presses; no smooth scrolling, no word wrap (`editor.wordWrap`, viewModelLines with line breaks), bidi format characters not drawn as `[U+XXXX]` (port/notes.md milestone 8); diff editor widget (side by side, inline, view zones, gutter toolbar, overview ruler, title actions; port/notes.md milestone 14): cargo test -p app diff_editor diff_gutter; Switch Side (`diffEditor.switchSide`, the selection mapped through the diff) and Focus Primary, Secondary and Other Side, in the diff and the multi diff editor: cargo test -p app switch_side; bracket pair guides (`editor.guides.bracketPairs`, `bracketPairsHorizontal`, `highlightActiveBracketPair`; guidesTextModelPart.ts) in every code editor, on a wrapped line only on the view lines `getViewLinesBracketGuides` keeps (viewModelLines.ts): cargo test -p app bracket_pair_guide; indent guides on a wrapped line repeated on its view lines only with a wrapping indent (`getViewLinesIndentGuides`, viewModelLines.ts), none past the wrapping column (`_maxIndentLeft`, indentGuides.ts): cargo test -p app wrapping_indent_repeats without_a_wrapping_indent; scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; no `renderWhitespace` yet; no smooth scrolling (port/notes.md milestone 8); scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; `editor.renderWhitespace` marks drawn as svg circles and arrows (editor/whitespace.rs, viewParts/whitespace): cargo test -p app whitespace, ui-pair notes.txt; control characters as Control Pictures (`editor.renderControlCharacters`, workbench/control_characters.rs): cargo test -p app control_characters; glyph margin and line number presses select lines, drags extend them, Alt adds a line cursor (mouseHandler.ts `startedOnLineNumbers`, workbench/gutter_mouse.rs): cargo test -p app gutter_presses; word wrap with view lines, Toggle Word Wrap and the wrap indicator (editor/word_wrap.rs: cargo test -p app word_wrap; ui-pair /tmp/m8wrap wrap.ts: breaks, End, Down and Alt+Z match the reference); bidi format characters as `[U+XXXX]` (cargo test -p app control_characters); minimap settings and the scrollbar context menu (cargo test -p app minimap editor_menus); `editor.smoothScrolling` over 125 ms for cursor, find and API reveals and mouse wheel notches (editor/smooth_scroll.rs, workbench/smooth_scrolling.rs: cargo test -p app smooth_scroll, the scrollable.test.ts cases); diff editor widget (side by side, inline, view zones, gutter toolbar, overview ruler, title actions; port/notes.md milestone 14): cargo test -p app diff_editor diff_gutter; each side its own editor (the original's cursor and active line number, inline only its line numbers wide), char changes filled past the line break (`shouldFillLineOnLineBreak`) but not in the inline deleted lines, the sides' overview ruler without the minimap background, a press with no move before it shows the scrollbars: cargo test -p app file_compare char_ranges a_click_without_a_move, ui-pair m12/compare.json; mouse selection: four clicks select all, a double click the word (`WordOperations.word`) or the inside of brackets and strings (`editor.doubleClickSelectsBlock`), double and triple click drags go on by words and lines, their Alt forms on the cursor added last, a drag past the text scrolls each frame (dragScrolling.ts) (editor/mouse_selection.rs, workbench/drag_scrolling.rs): cargo test -p app mouse_selection text_clicks_select a_selecting_drag_below (6), in the vertical scrollbar without the minimap, below the horizontal scrollbar's top and in a comment reply editor: cargo test -p app a_drag_into_the_vertical the_bottom_edge_hit a_drag_below_a_comment; the IME input handler sees the selection's lines, a caret inside marked text places the cursor and character bounds follow the text (nativeEditContext.ts): cargo test -p app text_input::; decoration type outlines outside the range and borders inside it, the CSS cascade of their shorthands and longhands, `before`/`after` content text as injected text (workbench/editor_view/text_decorations.rs): cargo test -p app outline_and_border_follow_the_css_cascade a_decoration_outline_is_drawn_outside_its_range decoration_types_set_and_remove_editor_decorations, ui-pair of a merge conflict file: the header's "(Incoming Change)" text matches the reference |
+| editor/browser | src/vs/editor | 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. | scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests (8); folding (editor/folding.rs): cargo test -p app editor::folding (49); minimap with slider, decorations, section headers, settings and the scrollbar context menu (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap (11), section_headers (18), editor_menus (8); sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`): cargo test -p app selection_corners (1); `editor.renderWhitespace` (editor/whitespace.rs): cargo test -p app whitespace (39); control characters and bidi format characters as `[U+XXXX]` (workbench/control_characters.rs): cargo test -p app control_characters (4); glyph margin and line number presses (workbench/gutter_mouse.rs): cargo test -p app gutter_presses (1); word wrap with view lines, Toggle Word Wrap and the wrap indicator (editor/word_wrap.rs): cargo test -p app word_wrap (21), ui-pair /tmp/m8wrap wrap.ts; `editor.smoothScrolling` (editor/smooth_scroll.rs, workbench/smooth_scrolling.rs): cargo test -p app smooth_scroll (11, the scrollable.test.ts cases); diff editor widget (port/notes.md milestone 14): cargo test -p app diff_editor (22), diff_gutter (2); all run at the milestone 20 sweep; scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; `editor.renderWhitespace` marks drawn as svg circles and arrows (editor/whitespace.rs, viewParts/whitespace): cargo test -p app whitespace, ui-pair notes.txt; control characters as Control Pictures (`editor.renderControlCharacters`, workbench/control_characters.rs): cargo test -p app control_characters; glyph margin and line number presses select lines, drags extend them, Alt adds a line cursor (mouseHandler.ts `startedOnLineNumbers`, workbench/gutter_mouse.rs): cargo test -p app gutter_presses; no smooth scrolling, no word wrap (`editor.wordWrap`, viewModelLines with line breaks), bidi format characters not drawn as `[U+XXXX]` (port/notes.md milestone 8); diff editor widget (side by side, inline, view zones, gutter toolbar, overview ruler, title actions; port/notes.md milestone 14): cargo test -p app diff_editor diff_gutter; Switch Side (`diffEditor.switchSide`, the selection mapped through the diff) and Focus Primary, Secondary and Other Side, in the diff and the multi diff editor: cargo test -p app switch_side; bracket pair guides (`editor.guides.bracketPairs`, `bracketPairsHorizontal`, `highlightActiveBracketPair`; guidesTextModelPart.ts) in every code editor, on a wrapped line only on the view lines `getViewLinesBracketGuides` keeps (viewModelLines.ts): cargo test -p app bracket_pair_guide; indent guides on a wrapped line repeated on its view lines only with a wrapping indent (`getViewLinesIndentGuides`, viewModelLines.ts), none past the wrapping column (`_maxIndentLeft`, indentGuides.ts): cargo test -p app wrapping_indent_repeats without_a_wrapping_indent; scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; no `renderWhitespace` yet; no smooth scrolling (port/notes.md milestone 8); scrolling: wheel, scrollbars with drag, track press and fade, scroll shadow, reveal on cursor moves and from the API, per-editor scroll position (editor/view.rs, workbench/editor_view.rs): cargo test -p app editor::view::tests; folding (editor/folding.rs): cargo test -p app editor::folding; minimap with slider, decorations and section headers (editor/minimap.rs, editor/section_headers.rs, workbench/minimap_view.rs): cargo test -p app minimap, cargo test -p app section_headers; sticky scroll (editor/contrib/stickyScroll row); rounded selections (`editor.roundedSelection`, selections.ts): cargo test -p app selection_corners, ui-pair corners match; `editor.renderWhitespace` marks drawn as svg circles and arrows (editor/whitespace.rs, viewParts/whitespace): cargo test -p app whitespace, ui-pair notes.txt; control characters as Control Pictures (`editor.renderControlCharacters`, workbench/control_characters.rs): cargo test -p app control_characters; glyph margin and line number presses select lines, drags extend them, Alt adds a line cursor (mouseHandler.ts `startedOnLineNumbers`, workbench/gutter_mouse.rs): cargo test -p app gutter_presses; word wrap with view lines, Toggle Word Wrap and the wrap indicator (editor/word_wrap.rs: cargo test -p app word_wrap; ui-pair /tmp/m8wrap wrap.ts: breaks, End, Down and Alt+Z match the reference); bidi format characters as `[U+XXXX]` (cargo test -p app control_characters); minimap settings and the scrollbar context menu (cargo test -p app minimap editor_menus); `editor.smoothScrolling` over 125 ms for cursor, find and API reveals and mouse wheel notches (editor/smooth_scroll.rs, workbench/smooth_scrolling.rs: cargo test -p app smooth_scroll, the scrollable.test.ts cases); diff editor widget (side by side, inline, view zones, gutter toolbar, overview ruler, title actions; port/notes.md milestone 14): cargo test -p app diff_editor diff_gutter; each side its own editor (the original's cursor and active line number, inline only its line numbers wide), char changes filled past the line break (`shouldFillLineOnLineBreak`) but not in the inline deleted lines, the sides' overview ruler without the minimap background, a press with no move before it shows the scrollbars: cargo test -p app file_compare char_ranges a_click_without_a_move, ui-pair m12/compare.json; mouse selection: four clicks select all, a double click the word (`WordOperations.word`) or the inside of brackets and strings (`editor.doubleClickSelectsBlock`), double and triple click drags go on by words and lines, their Alt forms on the cursor added last, a drag past the text scrolls each frame (dragScrolling.ts) (editor/mouse_selection.rs, workbench/drag_scrolling.rs): cargo test -p app mouse_selection text_clicks_select a_selecting_drag_below (6), in the vertical scrollbar without the minimap, below the horizontal scrollbar's top and in a comment reply editor: cargo test -p app a_drag_into_the_vertical the_bottom_edge_hit a_drag_below_a_comment; the IME input handler sees the selection's lines, a caret inside marked text places the cursor and character bounds follow the text (nativeEditContext.ts): cargo test -p app text_input::; decoration type outlines outside the range and borders inside it, the CSS cascade of their shorthands and longhands, `before`/`after` content text as injected text (workbench/editor_view/text_decorations.rs): cargo test -p app outline_and_border_follow_the_css_cascade a_decoration_outline_is_drawn_outside_its_range decoration_types_set_and_remove_editor_decorations, ui-pair of a merge conflict file: the header's "(Incoming Change)" text matches the reference; a padded inlay hint broken by word wrap draws a padding box per piece (word_wrap.rs `hint_splits`, inlayHintsController.ts `cssProperties.padding` per span): cargo test -p app wrapping_a_padded_inlay_hint_skips_its_padding_box, ui-pair port/fixtures/ui-pair/m8/inlay-hint-wrap.json dark with `PORT_MESSAGES=inlayHints FILE=notes.txt`, the messages extension and `editor.wordWrap` `wordWrapColumn` 24 plus `editor.inlayHints.padding`: matches the reference |
| editor/common | src/vs/editor | M8 | ported | [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. | the model and cursor layer under every editor (app/src/editor, decorations.rs, link_computer.rs, syntax.rs, the diff crate): cursors (CursorCollection normalize, per-cursor edits, loser edits, paste distribution, column selection), core moves and deletes over grapheme clusters, word operations, the edit stack with its stops and the alternative version id dirty state, onEnter and indentation rules (`languages/autoIndent.ts`, `enterAction.ts`, EnterOperation, electric characters, TabOperation, ShiftCommand miss-aligned lines), auto-closing of typed brackets and quotes (`AutoClosingOpenCharTypeOperation`, `hasUnmatchedClosingBracketAfter`: cargo test -p app auto_closing), indentation guessing, model decorations with injected text, bracket matching and bracket pair colorization over the incremental bracket tree (bracketPairsTree/, brackets/tree.rs: cargo test -p app brackets; typing on the 52k-line TS file 1.40, 1.73, 2.29 ms median per edit: cargo test --release -p app -- --ignored typing_latency_on_a_large_file), the lines in view past the tokenized ones tokenized from a guessed start state (`tokenizeHeuristically`: cargo test -p app lines_in_view_past_the_tokenized_ones), the link computer, view lines with word wrap: cargo test -p app editor:: decorations:: link_computer syntax:: (781 passed, 13 ignored: the upstream `test.skip` cases of indentation.test.ts); the diff algorithms of editor/common/diff: cargo test -p diff (15 passed). `getWordAtPosition` inside the token language with its `wordPattern`: cargo test -p app the_word_at_a_column (model.test.ts 'Get word at position', 'getWordAtPosition at embedded language boundaries', 'issue #61296'). Swapped by design: the piece tree text buffer is a vector of lines (no observable difference; large files go through workbench/large_file.rs). Gap (editor audit): pushEOL not on the undo stack (edit.rs). Full-width chars take two visible columns for tab stops and cursor moves and draw at the font's full-width advance: cargo test -p app full_width_chars_take moving_down_keeps. Language configuration regexes read a class hyphen next to `\w`, `\d` or `\s` as JavaScript does (css `[\w-?]`, folding.rs `marker_regex`): cargo test -p app a_hyphen_next_to_a_class_escape_is_literal. |
| editor/standalone | src/vs/editor | | removed | | Artur: internal infrastructure or developer tool with no 1:1 counterpart in the native port |
| editor/test | src/vs/editor | M6 | n/a | | upstream test infrastructure; the port tests with cargo test and port/tools |