Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(diffEditor): show the selection toolbar in the diff gutter

rokarturb24e3abdb851
diff --git a/README.md b/README.md
index e188c0b0f3e..90d08d63c09 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) (587 rows). V
```mermaid
pie showData
- "verified" : 414
- "ported" : 19
+ "verified" : 413
+ "ported" : 20
"removed" : 126
"n/a" : 28
```
@@ -20,7 +20,7 @@ pie showData
| area | verified | ported | removed | n/a | verified of in scope |
|---|---:|---:|---:|---:|---|
| workbench contribution | 61 | 9 | 30 | 3 | `█████████████████░░░ 87%` |
-| src/vs/platform | 69 | 0 | 30 | 13 | `████████████████████ 100%` |
+| src/vs/platform | 68 | 1 | 30 | 13 | `████████████████████ 99%` |
| built-in extension | 88 | 1 | 6 | 0 | `████████████████████ 99%` |
| MainThread* shape (Rust side) | 59 | 0 | 30 | 0 | `████████████████████ 100%` |
| workbench service | 63 | 2 | 23 | 7 | `███████████████████░ 97%` |
@@ -31,7 +31,7 @@ pie showData
| src/vs/editor | 0 | 2 | 1 | 1 | `░░░░░░░░░░░░░░░░░░░░ 0%` |
| src/vs/base | 0 | 0 | 2 | 3 | `████████████████████ 100%` |
| port feature | 1 | 0 | 0 | 0 | `████████████████████ 100%` |
-| **all** | **414** | **19** | **126** | **28** | `███████████████████░ 96%` |
+| **all** | **413** | **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/menus.rs b/native/crates/app/src/menus.rs
index 47a35bd8247..430f9be69b3 100644
--- a/native/crates/app/src/menus.rs
+++ b/native/crates/app/src/menus.rs
@@ -109,6 +109,8 @@ pub enum MenuId {
ScmHistoryItemRefAction(usize),
ScmChangeContext,
DiffEditorHunkToolbar,
+ /// `MenuId.DiffEditorSelectionToolbar`: the diff gutter's one toolbar over the selected changes.
+ DiffEditorSelectionToolbar,
/// `MenuId.MultiDiffEditorFileToolbar`: a multi diff editor file header's toolbar.
MultiDiffEditorFileToolbar,
/// `MenuId.MergeInputResultToolbar`: the merge editor result's title toolbar.
@@ -1008,6 +1010,7 @@ const API_MENUS: &[(&str, MenuId)] = &[
("scm/inputBox", MenuId::ScmInputBox),
("scm/change/title", MenuId::ScmChangeContext),
("diffEditor/gutter/hunk", MenuId::DiffEditorHunkToolbar),
+ ("diffEditor/gutter/selection", MenuId::DiffEditorSelectionToolbar),
("multiDiffEditor/resource/title", MenuId::MultiDiffEditorFileToolbar),
("editor/title", MenuId::EditorTitle),
("editor/title/run", MenuId::EditorTitleRun),
@@ -1166,6 +1169,7 @@ pub fn extension_menus(extensions: &[ScannedExtension]) -> Vec<MenuItem> {
"mergeEditor/result/title" => Some("contribMergeEditorMenus"),
"titleBar" => Some("contribTitleBar"),
"editor/inlineCompletions/actions" => Some("inlineCompletionsAdditions"),
+ "diffEditor/gutter/selection" => Some("contribDiffEditorGutterToolBarMenus"),
"scm/historyItemRef/context" => Some("contribSourceControlHistoryItemMenu"),
"viewContainer/title" => Some("contribViewContainerTitle"),
_ => None,
diff --git a/native/crates/app/src/workbench/editor_view/diff_gutter.rs b/native/crates/app/src/workbench/editor_view/diff_gutter.rs
index a552d29acbf..98226eb1fca 100644
--- a/native/crates/app/src/workbench/editor_view/diff_gutter.rs
+++ b/native/crates/app/src/workbench/editor_view/diff_gutter.rs
@@ -44,7 +44,15 @@ impl Workbench {
let Some((original, modified)) = line_range(&context["mapping"]["original"]).zip(line_range(&context["mapping"]["modified"])) else {
return crate::commands::Outcome::done();
};
- workbench.revert_block(&context["originalUri"], &context["modifiedUri"], original, modified, cx)
+ // diffEditorWidget.ts `revertRangeMappings`: a selection's mapping reverts only its inner changes.
+ let inner = match context["mapping"]["innerChanges"].as_array() {
+ Some(changes) => match changes.iter().map(range_mapping).collect::<Option<Vec<_>>>() {
+ Some(changes) => Some(changes),
+ None => return crate::commands::Outcome::done(),
+ },
+ None => None,
+ };
+ workbench.revert_block(&context["originalUri"], &context["modifiedUri"], original, modified, inner, cx)
});
}
@@ -55,25 +63,27 @@ impl Workbench {
}
pub(super) fn diff_gutter_width(&self, input: &DiffInput) -> f32 {
- self.gutter_width(&self.diff_hunk_actions(input))
+ self.gutter_width(&self.diff_hunk_actions(input, MenuId::DiffEditorHunkToolbar))
}
- fn diff_hunk_actions(&self, input: &DiffInput) -> Vec<HunkAction> {
+ fn diff_hunk_actions(&self, input: &DiffInput, menu: MenuId) -> Vec<HunkAction> {
let mut context = HashMap::new();
self.insert_diff_editor_context(&mut context);
- self.hunk_actions(Some(&input.modified), input.inline_now, &context)
+ self.hunk_actions(menu, Some(&input.modified), input.inline_now, &context)
}
- /// `MenuId.DiffEditorHunkToolbar` in a diff editor's `context`: Revert Block where the modified side is writable
- /// (diffEditor.contribution.ts, an arrow side by side and a discard icon inline), then the extensions' `primary`
- /// items. A missing modified side is an empty read-only model (multiDiffEditorInput.ts `getReadonlyConfiguration`).
- pub(super) fn hunk_actions(&self, modified: Option<&Side>, inline: bool, context: &HashMap<String, Value>) -> Vec<HunkAction> {
+ /// `menu` (`MenuId.DiffEditorHunkToolbar` or `DiffEditorSelectionToolbar`) in a diff editor's `context`: Revert
+ /// Block or Revert Selection where the modified side is writable (diffEditor.contribution.ts, an arrow side by side
+ /// and a discard icon inline), then the extensions' `primary` items. A missing modified side is an empty read-only
+ /// model (multiDiffEditorInput.ts `getReadonlyConfiguration`).
+ pub(super) fn hunk_actions(&self, menu: MenuId, modified: Option<&Side>, inline: bool, context: &HashMap<String, Value>) -> Vec<HunkAction> {
let mut actions = Vec::new();
if modified.is_some_and(|modified| self.readonly(&modified.scheme, &modified.path).is_none()) {
let icon = if inline { "discard" } else { "arrow-right" };
- actions.push(HunkAction { command: REVERT.into(), icon: icon.into(), title: "Revert Block".into() });
+ let title = if menu == MenuId::DiffEditorSelectionToolbar { "Revert Selection" } else { "Revert Block" };
+ actions.push(HunkAction { command: REVERT.into(), icon: icon.into(), title: title.into() });
}
- for action in menu_actions(&self.menus, MenuId::DiffEditorHunkToolbar, context) {
+ for action in menu_actions(&self.menus, menu, context) {
let MenuAction::Command { id, title, enabled: true, .. } = action else { continue };
let icon = match self.command_icons.get(&id) {
Some(crate::menus::CommandIcon::Codicon(name)) => name.clone(),
@@ -101,15 +111,22 @@ impl Workbench {
line if line < line_count => top_of(line) - top_of(line - 1) - viewport.line_height,
_ => 0.,
};
- let mut items = Vec::new();
- for change in &computed.diff.changes {
+ let item = |change: &diff::LineRangeMapping, show_always: bool, context: Value| {
let start = change.modified.start - 1;
let top = top_of(start) - zones_above(start) - modified.scroll.top;
let bottom = top_of(change.modified.end - 1).max(top_of(start)) - modified.scroll.top;
- let context = hunk_context(self, Some(&input.original), &input.modified, change);
- items.push((change.original.start, GutterItem { top, height: bottom - top, show_always: change.modified.contains(cursor), context }));
+ (change.original.start, GutterItem { top, height: bottom - top, show_always, context })
+ };
+ if let Some(selected) = selected_mapping(&computed.diff.changes, &modified.selections) {
+ let context = selection_context(self, &input.original, &input.modified, &selected);
+ let actions = self.diff_hunk_actions(input, MenuId::DiffEditorSelectionToolbar);
+ return self.gutter("diff-gutter".into(), &actions, vec![item(&selected, true, context)], 0., viewport.height, cx).h_full();
}
- let actions = self.diff_hunk_actions(input);
+ let mut items = Vec::new();
+ for change in &computed.diff.changes {
+ items.push(item(change, change.modified.contains(cursor), hunk_context(self, Some(&input.original), &input.modified, change)));
+ }
+ let actions = self.diff_hunk_actions(input, MenuId::DiffEditorHunkToolbar);
self.gutter("diff-gutter".into(), &actions, items, 0., viewport.height, cx).h_full()
}
@@ -164,8 +181,10 @@ impl Workbench {
fn hunk_button(&self, key: &str, icon: &str, title: &str, command: &str, context: Value, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
let id = SharedString::from(format!("diff-hunk-{key}-{command}-{icon}"));
+ let selector = id.clone();
let mut button = div()
.id(id.clone())
+ .debug_selector(move || selector.to_string())
.px(px(2.))
.py(px(1.))
.rounded(px(4.))
@@ -186,7 +205,7 @@ impl Workbench {
/// commands.ts `RevertHunkOrSelection` of a whole block: the modified lines get the original's (none for an
/// added file). The active diff editor's modified editor edits; a multi diff file's model edits as
/// `workspace.applyEdit` edits a model without an editor.
- fn revert_block(&mut self, original_uri: &Value, modified_uri: &Value, original: diff::LineRange, modified: diff::LineRange, cx: &mut Context<Self>) -> crate::commands::Outcome {
+ fn revert_block(&mut self, original_uri: &Value, modified_uri: &Value, original: diff::LineRange, modified: diff::LineRange, inner: Option<Vec<diff::RangeMapping>>, cx: &mut Context<Self>) -> crate::commands::Outcome {
let modified_side = match (uri_parts(modified_uri), self.editors.active_diff()) {
(Ok((scheme, path)), _) => Side { scheme: scheme.to_string(), path },
(Err(_), Some(input)) => input.modified.clone(),
@@ -206,31 +225,42 @@ impl Workbench {
}
// The ranges come from the command's arguments, which any extension can pass.
let fits = |range: diff::LineRange, count: usize| range.start >= 1 && range.start <= range.end && range.end <= count + 1;
- let Some(modified_count) = self.editors.model(scheme, path).map(|model| model.document().lines.len()) else { return crate::commands::Outcome::done() };
- if !fits(modified, modified_count) {
+ let Some((modified_lines, eol)) = self.editors.model(scheme, path).map(|model| (model.document().lines.clone(), model.document().eol)) else { return crate::commands::Outcome::done() };
+ if !fits(modified, modified_lines.len()) {
return crate::commands::Outcome::done();
}
- let original_lines = match original_side {
+ let original_text = match original_side {
Some(side) => match self.editors.model(&side.scheme, &side.path) {
- Some(model) if fits(original, model.document().lines.len()) => model.document().lines[original.start - 1..original.end - 1].to_vec(),
+ Some(model) if fits(original, model.document().lines.len()) => Some(model.document().lines.clone()),
_ => return crate::commands::Outcome::done(),
},
- None => Vec::new(),
+ None => None,
+ };
+ let edits = match inner {
+ None => {
+ let original_lines = original_text.map_or(Vec::new(), |lines| lines[original.start - 1..original.end - 1].to_vec());
+ let (start, end, text) = block_edit(&modified_lines, modified, &original_lines, eol);
+ vec![(start, end, text, false)]
+ }
+ Some(inner) => {
+ // An added file's original is an empty model.
+ let original_text = original_text.unwrap_or_else(|| vec![String::new()]);
+ let mut edits = Vec::new();
+ for change in inner {
+ if !range_fits(&original_text, change.original) || !range_fits(&modified_lines, change.modified) {
+ return crate::commands::Outcome::done();
+ }
+ edits.push((editor_position(change.modified.start), editor_position(change.modified.end), text_in(&original_text, change.original, eol), false));
+ }
+ edits
+ }
};
if in_active_diff {
- return self.run_indenting(
- |editor, _| {
- let eol = editor.document().eol;
- let (start, end, text) = block_edit(&editor.document().lines, modified, &original_lines, eol);
- editor.execute_edits(vec![(start, end, text, false)], None, EditReason::Unknown("revert")).into_iter().collect()
- },
- cx,
- );
+ return self.run_indenting(move |editor, _| editor.execute_edits(edits.clone(), None, EditReason::Unknown("revert")).into_iter().collect(), cx);
}
let Some(model) = self.editors.model_mut(scheme, path) else { return crate::commands::Outcome::done() };
- let (start, end, text) = block_edit(&model.document().lines, modified, &original_lines, model.document().eol);
model.push_undo_stop();
- let change = model.execute_edits(vec![(start, end, text, false)], None, EditReason::Unknown("revert"));
+ let change = model.execute_edits(edits, None, EditReason::Unknown("revert"));
model.push_undo_stop();
if let Some(change) = change {
self.send_model_edit(scheme, path, &change, cx);
@@ -265,6 +295,86 @@ fn line_range(value: &Value) -> Option<diff::LineRange> {
Some(diff::LineRange::new(value["startLineNumber"].as_u64()? as usize, value["endLineNumberExclusive"].as_u64()? as usize))
}
+fn range_value(range: diff::Range) -> Value {
+ json!({ "startLineNumber": range.start.line, "startColumn": range.start.column, "endLineNumber": range.end.line, "endColumn": range.end.column })
+}
+
+fn range(value: &Value) -> Option<diff::Range> {
+ let number = |key: &str| value[key].as_u64().map(|number| number as usize);
+ Some(diff::Range::new(number("startLineNumber")?, number("startColumn")?, number("endLineNumber")?, number("endColumn")?))
+}
+
+/// `{ originalRange, modifiedRange }` as the extension host gets a `RangeMapping`.
+fn range_mapping(value: &Value) -> Option<diff::RangeMapping> {
+ Some(diff::RangeMapping { original: range(&value["originalRange"])?, modified: range(&value["modifiedRange"])? })
+}
+
+/// Whether the 1-based `range` lies inside `lines`.
+fn range_fits(lines: &[String], range: diff::Range) -> bool {
+ let fits = |position: diff::Position| position.line >= 1 && position.column >= 1 && lines.get(position.line - 1).is_some_and(|line: &String| position.column <= line.chars().count() + 1);
+ fits(range.start) && fits(range.end)
+}
+
+fn editor_position(position: diff::Position) -> Position {
+ Position::new(position.line - 1, position.column - 1)
+}
+
+/// The byte offset of the 1-based `position` in `lines` joined by `eol`.
+fn offset(lines: &[String], position: diff::Position, eol: &str) -> usize {
+ let before: usize = lines[..position.line - 1].iter().map(|line| line.len() + eol.len()).sum();
+ let line = &lines[position.line - 1];
+ before + line.char_indices().nth(position.column - 1).map_or(line.len(), |(index, _)| index)
+}
+
+/// `getValueInRange`.
+fn text_in(lines: &[String], range: diff::Range, eol: &str) -> String {
+ lines.join(eol)[offset(lines, range.start, eol)..offset(lines, range.end, eol)].to_string()
+}
+
+/// gutterFeature.ts `_selectedDiffs` joined by `DetailedLineRangeMapping.fromRangeMappings`: the inner changes the
+/// modified editor's selections touch, of the changes on their lines; none while every selection is empty.
+fn selected_mapping(changes: &[diff::LineRangeMapping], selections: &[crate::editor::Selection]) -> Option<diff::LineRangeMapping> {
+ let ranges: Vec<_> = selections.iter().map(|selection| diff::Range::new(selection.anchor.line + 1, selection.anchor.column + 1, selection.head.line + 1, selection.head.column + 1)).collect();
+ if ranges.iter().all(diff::Range::is_empty) {
+ return None;
+ }
+ let on_selected_lines = |lines: diff::LineRange| ranges.iter().any(|range| range.start.line < lines.end && lines.start < range.end.line + 1);
+ let mut inner: Vec<diff::RangeMapping> = Vec::new();
+ for change in changes {
+ let Some(changes) = &change.inner_changes else { continue };
+ if on_selected_lines(change.modified) {
+ inner.extend(changes.iter().filter(|change| ranges.iter().any(|range| intersecting(change.modified, *range))));
+ }
+ }
+ let inclusive = |range: diff::Range| diff::LineRange::new(range.start.line, range.end.line + 1);
+ let original = inner.iter().map(|change| inclusive(change.original)).reduce(|a, b| a.join(&b))?;
+ let modified = inner.iter().map(|change| inclusive(change.modified)).reduce(|a, b| a.join(&b))?;
+ Some(diff::LineRangeMapping { original, modified, inner_changes: Some(inner) })
+}
+
+/// `Range.areIntersecting`: touching ranges do not intersect.
+fn intersecting(a: diff::Range, b: diff::Range) -> bool {
+ let before = |a: diff::Range, b: diff::Range| a.end.line < b.start.line || (a.end.line == b.start.line && a.end.column <= b.start.column);
+ !before(a, b) && !before(b, a)
+}
+
+/// The selection toolbar's `DiffEditorSelectionHunkToolbarContext`: its mapping carries the inner changes, and
+/// `computeStagedValue` applies only those to the original.
+fn selection_context(workbench: &Workbench, original: &Side, modified: &Side, mapping: &diff::LineRangeMapping) -> Value {
+ let mut context = hunk_context(workbench, Some(original), modified, mapping);
+ let inner = mapping.inner_changes.as_deref().expect("a selected mapping has its inner changes");
+ context["mapping"]["innerChanges"] = inner.iter().map(|change| json!({ "originalRange": range_value(change.original), "modifiedRange": range_value(change.modified) })).collect();
+ let (Some(original_model), Some(modified_model)) = (workbench.editors.model(&original.scheme, &original.path), workbench.editors.model(&modified.scheme, &modified.path)) else { return context };
+ let (original_lines, modified_lines, eol) = (&original_model.document().lines, &modified_model.document().lines, original_model.document().eol);
+ let mut staged = original_lines.join(eol);
+ for change in inner.iter().rev() {
+ let replacement = text_in(modified_lines, change.modified, eol);
+ staged.replace_range(offset(original_lines, change.original.start, eol)..offset(original_lines, change.original.end, eol), &replacement);
+ }
+ context["originalWithModifiedChanges"] = json!(staged);
+ context
+}
+
/// `DiffEditorSelectionHunkToolbarContext`: the change, the original with the change applied (`computeStagedValue`)
/// and both resources; an added file's original is an empty model without a resource.
pub(super) fn hunk_context(workbench: &Workbench, original: Option<&Side>, modified: &Side, change: &diff::LineRangeMapping) -> Value {
@@ -341,4 +451,57 @@ mod tests {
// A change too short for the margins keeps the centered position.
assert_eq!(toolbar_top(0., 18., 18., 600.), 0.);
}
+
+ /// gutterFeature.ts: a selection over changes replaces the hunk toolbars with one `MenuId.DiffEditorSelectionToolbar`
+ /// toolbar, whose Revert Selection reverts only the selected inner changes (`revertRangeMappings`) and whose
+ /// context stages only them (`computeStagedValue`).
+ #[gpui::test]
+ fn a_selection_over_changes_shows_the_selection_toolbar(cx: &mut gpui::TestAppContext) {
+ use crate::menus::{Entry, MenuItem};
+ let app_root = std::path::Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let theme = crate::theme::load_theme(&[exthost::scan::scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap()], "Dark Modern").unwrap();
+ let dir = std::env::temp_dir().join(format!("code-gpui-diff-selection-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(&dir).unwrap();
+ let (a, b) = (dir.join("a.txt"), dir.join("b.txt"));
+ std::fs::write(&a, "one\nalpha beta gamma delta\nfour\nfive\n").unwrap();
+ std::fs::write(&b, "one\nALPHA beta gamma DELTA\nfour\nFIVE\n").unwrap();
+ let settings = std::sync::Arc::new(std::sync::Mutex::new(config::service::Settings::load(config::registry::Registry::with_extensions(&[]), dir.join("User"), None)));
+ let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), settings, crate::host_sync::HostSync::new(std::sync::mpsc::channel().0), cx));
+ cx.simulate_resize(gpui::size(px(1600.), px(900.)));
+ workbench.update(cx, |workbench, _| {
+ let entry = Entry::Command { id: "port.stage".into(), precondition: None, toggled: None, alt: None };
+ workbench.menus.push(MenuItem { menu: MenuId::DiffEditorSelectionToolbar, entry, title: "Port Stage".into(), group: "primary".into(), order: 10., when: None });
+ });
+ let uri = |path: &std::path::Path| json!({ "scheme": "file", "path": path.to_string_lossy() });
+ workbench.update_in(cx, |workbench, window, cx| {
+ drop(workbench.execute_command("selectForCompare", vec![uri(&a)], window, cx));
+ drop(workbench.execute_command("compareFiles", vec![uri(&b)], window, cx));
+ });
+ let draw = |cx: &mut gpui::VisualTestContext| {
+ for _ in 0..3 {
+ cx.update(|window, _| window.refresh());
+ cx.run_until_parked();
+ }
+ };
+ draw(cx);
+ assert!(cx.debug_bounds("diff-hunk-diff-gutter-1-diffEditor.revert-arrow-right").is_some(), "no selection: a toolbar per change");
+ assert!(cx.debug_bounds("diff-hunk-diff-gutter-0-port.stage-symbol-misc").is_none(), "the hunk toolbar has no selection items");
+
+ workbench.update(cx, |workbench, _| workbench.editors.active_mut().unwrap().set_selections(vec![crate::editor::Selection { anchor: Position::new(1, 0), head: Position::new(1, 3) }]));
+ draw(cx);
+ assert!(cx.debug_bounds("diff-hunk-diff-gutter-1-diffEditor.revert-arrow-right").is_none(), "the selection toolbar replaces the hunk toolbars");
+ assert!(cx.debug_bounds("diff-hunk-diff-gutter-0-port.stage-symbol-misc").is_some(), "the selection toolbar shows diffEditor/gutter/selection");
+ let staged = workbench.read_with(cx, |workbench, _| {
+ let input = workbench.editors.active_diff().unwrap();
+ let selected = selected_mapping(&input.diff.as_ref().unwrap().diff.changes, &workbench.editors.active().unwrap().selections).unwrap();
+ selection_context(workbench, &input.original, &input.modified, &selected)["originalWithModifiedChanges"].clone()
+ });
+ assert_eq!(staged, json!("one\nALPHA beta gamma delta\nfour\nfive\n"));
+ let revert = cx.debug_bounds("diff-hunk-diff-gutter-0-diffEditor.revert-arrow-right").expect("Revert Selection is drawn");
+ cx.simulate_click(revert.center(), gpui::Modifiers::default());
+ let text = workbench.read_with(cx, |workbench, _| workbench.editors.active().unwrap().document().lines.join("\n"));
+ assert_eq!(text, "one\nalpha beta gamma DELTA\nfour\nFIVE\n");
+ std::fs::remove_dir_all(dir).unwrap();
+ }
}
diff --git a/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs b/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
index e4429e68a3b..755bf110f3e 100644
--- a/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view/multi_diff_editor_view.rs
@@ -1268,7 +1268,7 @@ impl Workbench {
fn multi_diff_hunk_actions(&self, file: &FileDiff, side_by_side: bool) -> Vec<HunkAction> {
let uri = |side: &Option<Side>| side.as_ref().map_or(Value::Null, |side| json!(crate::editor::uri_string(&side.scheme, &side.path)));
let context = HashMap::from([("isInDiffEditor".to_string(), json!(true)), ("diffEditorOriginalUri".to_string(), uri(&file.original)), ("diffEditorModifiedUri".to_string(), uri(&file.modified))]);
- self.hunk_actions(file.modified.as_ref(), !side_by_side, &context)
+ self.hunk_actions(MenuId::DiffEditorHunkToolbar, file.modified.as_ref(), !side_by_side, &context)
}
/// A file's `DiffEditorGutter` over its `rows`, which start `view_top` below the list's top: each change from the
diff --git a/port/fixtures/extensions/menus/package.json b/port/fixtures/extensions/menus/package.json
index 67635fd3926..1f1abd16f73 100644
--- a/port/fixtures/extensions/menus/package.json
+++ b/port/fixtures/extensions/menus/package.json
@@ -14,7 +14,8 @@
"contribViewContainerTitle",
"contribMergeEditorMenus",
"contribTitleBar",
- "inlineCompletionsAdditions"
+ "inlineCompletionsAdditions",
+ "contribDiffEditorGutterToolBarMenus"
],
"contributes": {
"commands": [
@@ -72,6 +73,11 @@
{
"command": "port.menus.inlineAction",
"title": "Port Inline Action"
+ },
+ {
+ "command": "port.menus.stageSelection",
+ "title": "Port Stage Selection",
+ "icon": "$(add)"
}
],
"menus": {
@@ -133,6 +139,12 @@
"group": "1_port"
}
],
+ "diffEditor/gutter/selection": [
+ {
+ "command": "port.menus.stageSelection",
+ "group": "primary@10"
+ }
+ ],
"mergeEditor/result/title": [
{
"command": "port.menus.mergeApply",
diff --git a/port/fixtures/ui-pair/menus/diff-gutter-selection.json b/port/fixtures/ui-pair/menus/diff-gutter-selection.json
new file mode 100644
index 00000000000..527e55229be
--- /dev/null
+++ b/port/fixtures/ui-pair/menus/diff-gutter-selection.json
@@ -0,0 +1,14 @@
+[
+ { "wait": 8000 },
+ { "click": [600, 200], "foreground": true },
+ { "hotkey": ["cmd", "up"] },
+ { "type": "x" },
+ { "hotkey": ["cmd", "k"] },
+ { "wait": 500 },
+ { "key": "d" },
+ { "wait": 3000 },
+ { "shot": "hunk" },
+ { "hotkey": ["shift", "right"] },
+ { "wait": 1000 },
+ { "shot": "selection" }
+]
diff --git a/port/ledger.md b/port/ledger.md
index 011424e73fc..61907079bd8 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -252,7 +252,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| platform/profiling | src/vs/platform | M19 | n/a | | V8 inspector CPU profiles of the Electron renderer (windowProfiling.ts, rendererAutoProfiler.ts) and their analysis worker, which feeds only telemetry (profilingTelemetrySpec.ts); the workbench is a native process, profiled with Instruments, and no telemetry by decision; the extension host profile commands belong to workbench/contrib/extensions |
| platform/progress | src/vs/platform | M11 | verified | | ProgressLocation values and the step shape, in main_thread_progress.rs; verified: ui-pair messages.json `progress` vs the reference (port/results/windows.md, milestone 11 verification) |
| platform/protocol | src/vs/platform | | n/a | | Electron process, IPC or DOM layer; replaced by the single-process Rust/GPUI architecture (port/notes.md) |
-| platform/quickinput | src/vs/platform | M9 | verified | | createQuickWidget as `Kind::Widget` (quick_input_view.rs: title, no input header, the icon picker as content) for its one workbench caller, iconPicker.ts `IconPicker` of Terminal: Change Icon: cargo test -p app the_icon_picker_search_is_a_bare_input_box a_quick_pick_shown_over_the_icon_picker_drops_its_content (quickinput.test.ts "custom content is exclusive to QuickWidget"); quickPickPin.ts pins match a terminal session command by its timestamp `id`, store label, description and detail, and stay for the session after the picker hides: cargo test -p app a_pinned_session_command_stays_pinned_until_the_session_ends; cargo test -p app quick_input, filters, tf_idf (`\p{Letter}` words: tf_idf::tests::words_follow_the_javascript_regex), command_palette: the model cases of quickinput.test.ts (pick, input, active and selected items, section navigation, keepScrollPosition, title bar visibility, close animation and reopening); api-tests quick input 11/11; ad-hoc palette screenshot 0.28% pixels differ at 2% fuzz; a row's description at the highlighted name's exact width (cargo test -p app the_description_follows_the_highlighted_name_s_exact_width; Cmd+P `ts` pair: `src` within 0.3 device px of the reference); a separator's buttons show while an item of its section is active (a_separator_s_buttons_show_while_an_item_of_its_section_is_active); an item's tooltip is its hover, 6px wider from the list's padding, kept on key down and hidden on a value change (an_item_s_tooltip_is_its_row_s_hover_until_the_value_changes; port/fixtures/ui-pair/quick-input-item-hover.json: the command palette hover falls back below the row as the reference's) |
+| platform/quickinput | src/vs/platform | M9 | ported | [3 S] quick_input_view.rs:946: `input.rows[other]` panics (index out of bounds: the len is 4 but the index is 7) when a hovered or focused row index outlives a narrowed list, seen typing "compare active file with saved" into the command palette after a click | createQuickWidget as `Kind::Widget` (quick_input_view.rs: title, no input header, the icon picker as content) for its one workbench caller, iconPicker.ts `IconPicker` of Terminal: Change Icon: cargo test -p app the_icon_picker_search_is_a_bare_input_box a_quick_pick_shown_over_the_icon_picker_drops_its_content (quickinput.test.ts "custom content is exclusive to QuickWidget"); quickPickPin.ts pins match a terminal session command by its timestamp `id`, store label, description and detail, and stay for the session after the picker hides: cargo test -p app a_pinned_session_command_stays_pinned_until_the_session_ends; cargo test -p app quick_input, filters, tf_idf (`\p{Letter}` words: tf_idf::tests::words_follow_the_javascript_regex), command_palette: the model cases of quickinput.test.ts (pick, input, active and selected items, section navigation, keepScrollPosition, title bar visibility, close animation and reopening); api-tests quick input 11/11; ad-hoc palette screenshot 0.28% pixels differ at 2% fuzz; a row's description at the highlighted name's exact width (cargo test -p app the_description_follows_the_highlighted_name_s_exact_width; Cmd+P `ts` pair: `src` within 0.3 device px of the reference); a separator's buttons show while an item of its section is active (a_separator_s_buttons_show_while_an_item_of_its_section_is_active); an item's tooltip is its hover, 6px wider from the list's padding, kept on key down and hidden on a value change (an_item_s_tooltip_is_its_row_s_hover_until_the_value_changes; port/fixtures/ui-pair/quick-input-item-hover.json: the command palette hover falls back below the row as the reference's) |
| platform/registry | src/vs/platform | M9 | n/a | | Registry.add/as, a string-keyed registry of registries for the JS module graph; the port passes its typed registries directly (config::registry::Registry, Commands, the menus and keybindings modules), so there is no lookup by id to port |
| platform/remote | src/vs/platform | | removed | | no remote or tunnels by decision (port/notes.md); one local extension host |
| platform/remoteTunnel | src/vs/platform | | removed | | no sign-in/AI by decision (port/notes.md); not ported |
@@ -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 M] editor_view/diff_gutter.rs: no selection toolbar (gutterFeature.ts:140): a selection over changes shows one `diffEditor/gutter/selection` item over the selected mappings in place of the hunk toolbars <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; 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/browser | 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. | 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); a selection over changes shows one `diffEditor/gutter/selection` toolbar (Revert Selection and contributions) in place of the hunk toolbars, reverting and staging only the selected inner changes (gutterFeature.ts `_selectedDiffs`, diffEditorWidget.ts `revertRangeMappings`): cargo test -p app a_selection_over_changes_shows_the_selection_toolbar, ui-pair port/fixtures/ui-pair/menus/diff-gutter-selection.json with `FILE=notes.txt` and the menus fixture extension: matches the reference; 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 |