Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(custom-editor): give each custom text editor tab its own webview

rokarturdd41a52cc755
diff --git a/README.md b/README.md
index cb5a31fedaf..5f1c7296ba2 100644
--- a/README.md
+++ b/README.md
@@ -7,12 +7,12 @@ Not a fork of VS Code's TypeScript: this repository holds the port only. Upstrea
## Coverage
<!-- coverage:start -->
-Coverage of VS Code 1.147.0, from [port/ledger.md](port/ledger.md) (585 rows). Verified means 1:1 with a named check; ported means written, with its open gaps in the same row.
+Coverage of VS Code 1.147.0, from [port/ledger.md](port/ledger.md) (584 rows). Verified means 1:1 with a named check; ported means written, with its open gaps in the same row.
```mermaid
pie showData
"verified" : 407
- "ported" : 24
+ "ported" : 23
"removed" : 126
"n/a" : 28
```
@@ -20,7 +20,7 @@ pie showData
| area | verified | ported | removed | n/a | verified of in scope |
|---|---:|---:|---:|---:|---|
| src/vs/platform | 68 | 1 | 30 | 13 | `████████████████████ 99%` |
-| workbench contribution | 58 | 11 | 30 | 3 | `█████████████████░░░ 84%` |
+| workbench contribution | 58 | 10 | 30 | 3 | `█████████████████░░░ 85%` |
| built-in extension | 88 | 1 | 6 | 0 | `████████████████████ 99%` |
| MainThread* shape (Rust side) | 59 | 0 | 30 | 0 | `████████████████████ 100%` |
| workbench service | 58 | 7 | 23 | 7 | `██████████████████░░ 89%` |
@@ -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** | **407** | **24** | **126** | **28** | `███████████████████░ 94%` |
+| **all** | **407** | **23** | **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/workbench/custom_documents/tests.rs b/native/crates/app/src/workbench/custom_documents/tests.rs
index dd45841c41f..0e536b7f8ac 100644
--- a/native/crates/app/src/workbench/custom_documents/tests.rs
+++ b/native/crates/app/src/workbench/custom_documents/tests.rs
@@ -272,6 +272,53 @@ fn a_custom_document_with_multiple_editors_opens_one_more_in_the_active_group(cx
assert_eq!((first, second), (vec![WEBVIEW_PANEL_SCHEME.to_owned(), "file".to_owned()], vec!["file".to_owned(), WEBVIEW_PANEL_SCHEME.to_owned()]));
}
+/// customEditorInput.ts: each editor of a custom text editor's resource has a webview of its own, the one opened in
+/// another group and the copy a split makes.
+#[gpui::test]
+fn each_group_s_custom_text_editor_has_its_own_webview(cx: &mut TestAppContext) {
+ let dir = scratch();
+ std::fs::write(dir.join("folder/b.txt"), "b").unwrap();
+ let (workbench, receiver, cx) = open(cx, &dir);
+ let extension = json!({ "id": "port.test", "location": { "scheme": "file", "path": "/ext" } });
+ let args = [extension, json!("test.text"), json!({}), json!({ "supportsMove": false }), json!(false)];
+ let first = workbench.update_in(cx, |workbench, window, cx| {
+ drop(workbench.handle_custom_editors_request("$registerTextEditorProvider", &args, window, cx));
+ workbench.open_file(dir.join("folder/b.txt"), true, window, cx);
+ let first = workbench.editors.id;
+ workbench.execute_command("workbench.action.splitEditorRight", Vec::new(), window, cx);
+ first
+ });
+ cx.run_until_parked();
+ let open_a = |cx: &mut VisualTestContext| {
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.open_with_resolver(&resource(&dir), Some("test.text"), json!({ "pinned": true }), window, cx)));
+ cx.run_until_parked();
+ };
+ let mut resolved = Vec::new();
+ let mut resolve = |cx: &mut VisualTestContext| {
+ let message = next(&receiver, "$resolveCustomEditor");
+ resolved.push(message.args[1].clone());
+ answer(message, Value::Null, cx);
+ };
+ open_a(cx);
+ resolve(cx);
+ run(&workbench, "workbench.action.splitEditorRight", cx);
+ resolve(cx);
+ workbench.update_in(cx, |workbench, window, cx| workbench.focus_group(first, window, cx));
+ open_a(cx);
+ resolve(cx);
+ let shown = workbench.read_with(cx, |workbench, _| {
+ let groups = workbench.groups_in_grid_order();
+ let active = |group| {
+ let (editors, active) = workbench.editors.group_tabs(group);
+ workbench.custom_editor_over(&editors[active.unwrap()]).map(|panel| json!(panel.handle))
+ };
+ groups.into_iter().map(active).collect::<Vec<_>>()
+ });
+ assert_eq!(resolved, [json!("custom-editor-1"), json!("custom-editor-2"), json!("custom-editor-3")]);
+ assert_eq!(shown, [Some(json!("custom-editor-3")), Some(json!("custom-editor-1")), Some(json!("custom-editor-2"))]);
+ let _ = std::fs::remove_dir_all(dir);
+}
+
/// editorResolverService.ts `doHandleConflictingDefaults`: two default editors for a.bin and no association warn once;
/// closing the warning keeps the first and stores the editors for `*.bin`, so the next open does not ask.
#[gpui::test]
diff --git a/native/crates/app/src/workbench/custom_editors.rs b/native/crates/app/src/workbench/custom_editors.rs
index 327d182d7c8..7044bbf05d9 100644
--- a/native/crates/app/src/workbench/custom_editors.rs
+++ b/native/crates/app/src/workbench/custom_editors.rs
@@ -169,18 +169,18 @@ impl Workbench {
};
match view_type {
Some(view_type) if self.is_notebook_type(&view_type) => {
- self.detach_custom_editors(resource, None);
+ self.detach_custom_editors(resource);
self.open_notebook(resource.clone(), view_type, options, window, cx)
}
Some(view_type) => match media_kind(&view_type) {
Some(kind) => {
- self.detach_custom_editors(resource, None);
+ self.detach_custom_editors(resource);
self.open_media_preview(kind, &view_type, resource, &options, window, cx)
}
None => self.open_custom_editor(view_type, resource.clone(), options, window, cx),
},
None => {
- self.detach_custom_editors(resource, None);
+ self.detach_custom_editors(resource);
self.api_open_editor_resolving(vec![resource.clone(), json!([null, options])], window, cx)
}
}
@@ -379,7 +379,7 @@ impl Workbench {
let path = editor.document().path.clone();
return Some(self.undo_custom_document(&path, direction, window, cx));
}
- let custom_text = self.webview_panels.panels.iter().any(|panel| panel.custom.is_some() && panel.scheme != WEBVIEW_PANEL_SCHEME && editor.document().is(&panel.scheme, &panel.path));
+ let custom_text = self.custom_editor_over(editor).is_some();
custom_text.then(|| self.run_on_active_editor(command, cx))
}
@@ -407,7 +407,7 @@ impl Workbench {
if editor.document().scheme == super::terminal_editor::TERMINAL_EDITOR_SCHEME {
return None;
}
- match self.webview_panels.panels.iter().find(|panel| editor.document().is(&panel.scheme, &panel.path)) {
+ match self.webview_panels.panels.iter().find(|panel| panel.shows(editor)) {
Some(panel) => panel.custom.as_ref().map(|custom| (custom.resource.clone(), panel.view_type.clone())),
None => Some((editor.document().uri(), TEXT_EDITOR_ID.to_owned())),
}
@@ -659,40 +659,37 @@ impl Workbench {
/// A custom text editor attaches a webview to the resource's text editor, opened or shown as `$tryShowTextDocument`
/// does; a custom document gets a webview panel's editor of its own, one per resource and view type.
fn show_custom_editor(&mut self, view_type: &str, resource: &Value, options: &Value, window: &mut Window, cx: &mut Context<Self>) -> Result<String, Value> {
- let (scheme, path) = uri_parts(resource)?;
- let scheme = scheme.to_owned();
+ let (_, path) = uri_parts(resource)?;
let provider = &self.webview_panels.custom_editors.providers[view_type];
let (text, extension, retain) = (provider.text, provider.extension.clone(), provider.options["retainContextWhenHidden"] == true);
let find_enabled = provider.options["enableFindWidget"] == true;
let multiple = provider.supports_multiple_editors;
let title = path.file_name().map(|name| name.to_string_lossy().into_owned()).unwrap_or_default();
let backup_id = options["backupId"].as_str().map(str::to_owned);
- let custom = Some(CustomEditor { resource: resource.clone(), resolved: false, backup_id, navigation: Navigation::None });
- let shows = |panel: &WebviewPanel| panel.view_type == view_type && panel.custom.as_ref().is_some_and(|custom| custom.resource == *resource);
- let in_active_group = |panel: &WebviewPanel| self.editors.editors.iter().any(|editor| panel.shows(editor));
- // A custom document with several editors gets one more in the active group.
- // shortcut: a custom text editor's panel is keyed by the text model, so its editors in two groups share one
- // webview; upstream gives each its own (supportsMultipleEditorsPerDocument). Key panels by editor to fix.
- let shows = |panel: &WebviewPanel| shows(panel) && (text || !multiple || in_active_group(panel));
- let handle = match self.webview_panels.panels.iter().find(|panel| shows(panel)) {
- Some(panel) => panel.handle.clone(),
- None if text => {
- self.detach_custom_editors(resource, Some(view_type));
- let handle = self.next_custom_editor_handle();
- self.webview_panels.panels.push(WebviewPanel::new(handle.clone(), scheme, path, view_type, title, &extension, Value::Null, retain, custom));
- handle
- }
- None => self.add_custom_document_editor(view_type, title, &extension, retain, custom, options["pinned"] != true),
- };
- if let Some(panel) = self.webview_panel_mut(&handle) {
- panel.find_enabled = find_enabled;
- }
- if text {
+ let custom = CustomEditor { resource: resource.clone(), resolved: false, backup_id, navigation: Navigation::None };
+ let handle = if text {
// The selection goes to the panel (`$revealCustomTextEditorRange`), not to the text model under it.
let mut options = options.clone();
options["selection"] = Value::Null;
self.try_show_text_document(resource, &options, window, cx)?;
+ let tab = self.editors.active_tab().expect("just shown").model_id;
+ let handle = self.attach_custom_text_editor(tab, view_type, custom)?;
+ self.editors_changed(cx);
+ handle
} else {
+ let shows = |panel: &WebviewPanel| panel.view_type == view_type && panel.custom.as_ref().is_some_and(|custom| custom.resource == *resource);
+ let in_active_group = |panel: &WebviewPanel| self.editors.editors.iter().any(|editor| panel.shows(editor));
+ // A custom document with several editors gets one more in the active group.
+ let handle = match self.webview_panels.panels.iter().find(|panel| shows(panel) && (!multiple || in_active_group(panel))) {
+ Some(panel) => panel.handle.clone(),
+ None => self.add_custom_document_editor(view_type, title, &extension, retain, Some(custom), options["pinned"] != true),
+ };
+ if let Some(panel) = self.webview_panel_mut(&handle) {
+ panel.find_enabled = find_enabled;
+ }
+ handle
+ };
+ if !text {
// editorResolverService.ts `moveExistingEditorForResource`: a singleton editor in another group moves here.
let (group, index) = self.webview_editor_group(&handle).expect("the panel's editor is open");
if group != self.editors.id {
@@ -730,18 +727,51 @@ impl Workbench {
Some((provider.extension.clone(), provider.options["retainContextWhenHidden"] == true))
}
- /// Removes the custom text editors of `resource` other than `keep`, as reopening it with another editor does.
- fn detach_custom_editors(&mut self, resource: &Value, keep: Option<&str>) {
+ /// Removes the active group's custom text editors of `resource`, as reopening it with another editor does.
+ fn detach_custom_editors(&mut self, resource: &Value) {
+ let tabs: Vec<u32> = self.editors.editors.iter().map(|editor| editor.model_id).collect();
+ self.detach_custom_text_editors(|panel| panel.editor.is_some_and(|tab| tabs.contains(&tab)) && panel.custom.as_ref().is_some_and(|custom| custom.resource == *resource));
+ }
+
+ /// Disposes the custom text editors' webviews `detached` picks: their tabs show the text editor again.
+ fn detach_custom_text_editors(&mut self, detached: impl Fn(&WebviewPanel) -> bool) {
let panels = std::mem::take(&mut self.webview_panels.panels);
for panel in panels {
- let detached = panel.scheme != WEBVIEW_PANEL_SCHEME && Some(panel.view_type.as_str()) != keep && panel.custom.as_ref().is_some_and(|custom| custom.resource == *resource);
- match detached {
+ match panel.editor.is_some() && detached(&panel) {
true => self.host.send("ExtHostWebviewPanels", "$onDidDisposeWebviewPanel", vec![json!(panel.handle)]),
false => self.webview_panels.panels.push(panel),
}
}
}
+ /// customEditorInput.ts for a text editor: each tab of the resource has a webview of its own. The tab keeps its
+ /// webview of `view_type`; one of another view type goes.
+ pub(super) fn attach_custom_text_editor(&mut self, tab: u32, view_type: &str, custom: CustomEditor) -> Result<String, Value> {
+ if let Some(panel) = self.webview_panels.panels.iter().find(|panel| panel.editor == Some(tab) && panel.view_type == view_type) {
+ return Ok(panel.handle.clone());
+ }
+ self.detach_custom_text_editors(|panel| panel.editor == Some(tab));
+ let (scheme, path) = uri_parts(&custom.resource)?;
+ let (scheme, title) = (scheme.to_owned(), path.file_name().map(|name| name.to_string_lossy().into_owned()).unwrap_or_default());
+ let provider = &self.webview_panels.custom_editors.providers[view_type];
+ let (extension, retain, find_enabled) = (provider.extension.clone(), provider.options["retainContextWhenHidden"] == true, provider.options["enableFindWidget"] == true);
+ let handle = self.next_custom_editor_handle();
+ let mut panel = WebviewPanel::new(handle.clone(), scheme, path, view_type, title, &extension, Value::Null, retain, Some(custom));
+ panel.editor = Some(tab);
+ panel.find_enabled = find_enabled;
+ self.webview_panels.panels.push(panel);
+ Ok(handle)
+ }
+
+ /// customEditorInput.ts `copy`: the copy of a custom text editor's tab that a split makes gets a webview of its own.
+ pub(super) fn copy_custom_text_editor(&mut self, source: u32, copy: u32) {
+ let Some(panel) = self.webview_panels.panels.iter().find(|panel| panel.editor == Some(source)) else { return };
+ let resource = panel.custom.as_ref().expect("a custom text editor's panel").resource.clone();
+ let custom = CustomEditor { resource, resolved: false, backup_id: None, navigation: Navigation::None };
+ let view_type = panel.view_type.clone();
+ self.attach_custom_text_editor(copy, &view_type, custom).expect("the resource of an open panel");
+ }
+
pub(super) fn next_custom_editor_handle(&mut self) -> String {
self.webview_panels.custom_editors.next_handle += 1;
format!("custom-editor-{}", self.webview_panels.custom_editors.next_handle)
@@ -751,7 +781,7 @@ impl Workbench {
/// created first, once per resource and view type. The host has the text editor's document already, since
/// `editors_changed` sent it on the same channel.
pub(super) fn resolve_custom_editors(&mut self, cx: &mut Context<Self>) {
- let active = self.webview_panels.panels.iter().position(|panel| self.editors.active().is_some_and(|editor| editor.document().is(&panel.scheme, &panel.path)));
+ let active = self.webview_panels.panels.iter().position(|panel| self.editors.active().is_some_and(|editor| panel.shows(editor)));
let providers = &self.webview_panels.custom_editors.providers;
let mut resolves = Vec::new();
for index in 0..self.webview_panels.panels.len() {
diff --git a/native/crates/app/src/workbench/editor_groups.rs b/native/crates/app/src/workbench/editor_groups.rs
index 8d753871bd8..b71b67c11c2 100644
--- a/native/crates/app/src/workbench/editor_groups.rs
+++ b/native/crates/app/src/workbench/editor_groups.rs
@@ -444,9 +444,14 @@ impl Workbench {
pub(super) fn split_editor(&mut self, direction: Direction, window: &mut Window, cx: &mut Context<Self>) {
let copy = self.editors.active_tab().is_some_and(|tab| copies_into_split(&tab.document().scheme));
let source = self.editors.id;
+ let source_tab = self.editors.active_tab().map(|tab| tab.model_id);
let group = self.editors.add_group(copy);
+ if let (Some(source_tab), Some(copy_tab)) = (source_tab, self.editors.group_tabs(group).0.first().map(|tab| tab.model_id)) {
+ self.copy_custom_text_editor(source_tab, copy_tab);
+ }
self.add_to_grid(source, direction, group);
self.focus_group(group, window, cx);
+ self.resolve_custom_editors(cx);
}
/// editorActions.ts `CloseEditorsInOtherGroupsAction`: each group closes all its editors in turn (a save prompt
diff --git a/native/crates/app/src/workbench/webview_panels.rs b/native/crates/app/src/workbench/webview_panels.rs
index 4c3cd4df95f..08fdd139bf5 100644
--- a/native/crates/app/src/workbench/webview_panels.rs
+++ b/native/crates/app/src/workbench/webview_panels.rs
@@ -69,6 +69,9 @@ pub(super) struct WebviewPanel {
/// overlayWebview.ts `_firstLoadPendingMessages`: the messages posted before the first webview was made.
first_load_messages: Option<Vec<Value>>,
pub(super) custom: Option<CustomEditor>,
+ /// A custom text editor's tab, by model id: each editor of the resource has a webview of its own
+ /// (`supportsMultipleEditorsPerDocument`).
+ pub(super) editor: Option<u32>,
/// A built-in media preview's page, which talks to the workbench instead of an extension.
pub(super) media: Option<MediaPreview>,
/// `enableFindWidget` of the panel options, and the find widget's state (`webviewFindWidgetVisible`,
@@ -277,15 +280,15 @@ impl Workbench {
// shortcut: the webview hides under these overlays, where Electron draws them over its iframe.
let covered = self.quick_inputs.current().is_some() || self.keybindings_editor.open || self.context_menu.is_some();
// The modal part covers the grid's webviews.
- let modal = self.modal_group_open().then(|| self.editors.group_tabs(crate::editor::MODAL_GROUP)).and_then(|(editors, active)| active.map(|index| editors[index].document()));
- let modal = modal.map(|document| (document.scheme.clone(), document.path.clone()));
+ let modal = self.modal_group_open().then(|| self.editors.group_tabs(crate::editor::MODAL_GROUP)).and_then(|(editors, active)| active.map(|index| &editors[index]));
+ let modal = modal.map(|editor| (editor.document().scheme.clone(), editor.document().path.clone(), editor.model_id));
let gpui_focused = window.focused(cx).is_some();
let mut created = Vec::new();
let mut revived = Vec::new();
for panel in &mut self.webview_panels.panels {
let shown = match panel.scheme == WEBVIEW_VIEW_SCHEME {
true => visible_views.contains(&panel.path),
- false => visible_editors.iter().any(|(scheme, path)| panel.scheme == *scheme && panel.path == *path),
+ false => visible_editors.iter().any(|visible| panel.covers(visible)),
};
if shown && panel.webview.is_none() && webview::supported() {
created.push(panel.handle.clone());
@@ -293,7 +296,7 @@ impl Workbench {
if shown && panel.revive {
revived.push(panel.handle.clone());
}
- let under_modal = modal.as_ref().is_some_and(|(scheme, path)| !(panel.scheme == *scheme && panel.path == *path));
+ let under_modal = modal.as_ref().is_some_and(|modal| !panel.covers(modal));
match (&panel.webview, shown) {
(Some(webview), true) if covered || under_modal => webview.hide(),
(Some(webview), true) if gpui_focused => webview.release_keyboard(),
@@ -379,13 +382,13 @@ impl Workbench {
Some(document)
}
- /// The scheme and path of each group's active editor, the modal group's included while it is open.
- fn visible_editor_documents(&self) -> Vec<(String, PathBuf)> {
+ /// The scheme, path and model id of each group's active editor, the modal group's included while it is open.
+ fn visible_editor_documents(&self) -> Vec<(String, PathBuf, u32)> {
let modal = self.modal_group_open().then_some(crate::editor::MODAL_GROUP);
let groups = self.groups_in_grid_order().into_iter().chain(modal);
let active = groups.filter_map(|group| {
let (editors, active) = self.editors.group_tabs(group);
- active.map(|index| (editors[index].document().scheme.clone(), editors[index].document().path.clone()))
+ active.map(|index| (editors[index].document().scheme.clone(), editors[index].document().path.clone(), editors[index].model_id))
});
active.collect()
}
@@ -395,7 +398,7 @@ impl Workbench {
fn release_hidden_webview_panels(&mut self) {
let visible_editors = self.visible_editor_documents();
for panel in &mut self.webview_panels.panels {
- let shown = visible_editors.iter().any(|(scheme, path)| panel.scheme == *scheme && panel.path == *path);
+ let shown = visible_editors.iter().any(|visible| panel.covers(visible));
if panel.scheme != WEBVIEW_VIEW_SCHEME && !shown && !panel.retain_context_when_hidden {
panel.webview = None;
}
@@ -755,6 +758,7 @@ impl WebviewPanel {
webview: None,
first_load_messages: Some(Vec::new()),
custom,
+ editor: None,
media: None,
find_enabled: false,
carousel: None,
@@ -771,7 +775,12 @@ impl WebviewPanel {
}
pub(super) fn shows(&self, editor: &OpenEditor) -> bool {
- editor.document().is(&self.scheme, &self.path)
+ self.covers(&(editor.document().scheme.clone(), editor.document().path.clone(), editor.model_id))
+ }
+
+ /// Whether the panel shows over the tab of this scheme, path and model id.
+ fn covers(&self, (scheme, path, model_id): &(String, PathBuf, u32)) -> bool {
+ self.scheme == *scheme && self.path == *path && self.editor.is_none_or(|editor| editor == *model_id)
}
/// webviewElement.ts `doUpdateContent`.
diff --git a/port/ledger.md b/port/ledger.md
index ee2236eeb2d..f1c129b1cfd 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -474,7 +474,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/codeEditor | workbench contribution | M8 | verified | | quickaccess/gotoLineQuickAccess (Go to Line/Column, Go to Offset) ported; toggleRenderWhitespace's View: Toggle Render Whitespace and toggleMinimap's View: Toggle Minimap with `editor.minimap.enabled` (workbench/editor_commands.rs, ui-pair notes.txt); toggleColumnSelection's Toggle Column Selection Mode with its Selection menu check, and `editor.columnSelection` drags and Shift+clicks selecting a column (cargo test -p app column_selection_mode); toggleMultiCursorModifier's Toggle Multi-Cursor Modifier and its Selection menu items, with `editor.multiCursorModifier` `ctrlCmd` making Cmd+click the multi-cursor click (cargo test -p app multi_cursor_modifier); saveParticipants' text participants (cargo test -p app save_participants) and `CodeActionOnSaveParticipant` with `editor.codeActionsOnSave` before formatting (workbench/code_actions/on_save.rs: cargo test -p app code_actions), its `triggerCodeActionsCommand` running the `always` source kinds on window focus and active editor changes with `editor.codeActions.triggerOnFocusChange` and `files.autoSave` `afterDelay` (cargo test -p app a_window_focus_change_runs_the_always_code_actions_on_save); toggleOvertype's Toggle Overtype/Insert Mode with typing, IME composition and `editor.overtypeOnPaste` paste overtyping, its OVR status item and block cursor (cargo test -p app overtype_mode; ui-pair notes.txt); toggleRenderControlCharacter's Toggle Control Characters (workbench/editor_commands.rs); largeFileOptimizations' prompt with Forcefully Enable Features and Don't Show Again, and `isTooLargeForTokenization` turning off tokens, folding, word and selection highlights and sticky scroll (workbench/large_file.rs: cargo test -p app large_file); editorLineNumberMenu's `editor/lineNumber/context` menu with `editorLineNumber` (cargo test -p app the_line_number_menu); toggleWordWrap's View: Toggle Word Wrap (Alt+Z), View > Word Wrap and the long-lines editor title action over `editor.wordWrap` wrapping (editor/word_wrap.rs: cargo test -p app word_wrap, the monospaceLineBreaksComputer.test.ts cases; ui-pair wrap.ts); inspectEditorTokens with the semantic token's table from the first document or range provider (workbench/inspect_tokens.rs: cargo test -p app inspect_tokens a_semantic_token_adds_its_table_and_strikes_the_textmate_rule_it_overrides, a fresh tokenization past the line length limit: a_line_past_the_tokenization_limit_is_tokenized_for_the_inspector), the editor accessibility help (workbench/accessible_view.rs), quickaccess/gotoSymbolQuickAccess and the outline (workbench/quick_access/goto_symbol.rs, workbench/outline_pane.rs: cargo test -p app goto_symbol outline_pane); emptyTextEditorHint without its inline chat parts (workbench/empty_editor_hint.rs: cargo test -p app empty_editor_hint; ui-pair port/fixtures/ui-steps/empty-editor-hint.json: same text, links, italics and wrap at the editor width); diffEditorHelper.ts: the "Show Whitespace Differences" button of a whitespace-only diff and the "The diff algorithm was stopped early" prompt with Remove Limit (workbench/editor_view/diff_editor_view.rs: cargo test -p app a_whitespace_only_diff_offers_to_show_whitespace a_diff_stopped_early_offers_to_remove_the_limit; ui-pair port/fixtures/diff-whitespace/steps.json: the same button, then the same whitespace diff with the toggled action and the cursor left at Ln 1, Col 1). Removed by decision: dictation and the voice parts (AI), diffEditorTryout (an experiment), startDebugTextMate (a developer tool), menuPreventer and selectionClipboard (Linux), and Electron's displayChangeRemeasureFonts and sleepResumeRepaintMinimap workarounds. editorSettingsMigration and diffEditorHelper's `collapseUnchangedRegions` migration through ConfigurationMigrationWorkbenchContribution: every migrateOptions.ts item rewritten in user, workspace and multi-root folder settings and their `[language]` blocks, at startup and when folders are added (workbench/configuration_migration.rs: cargo test -p app configuration_migration). emptyEditorHintActions without its chat rows: the experimental `workbench.editor.experimental.emptyEditorHintActions` list with Select a Language, the editor last picked from the hint or the Markdown Editor matched through `getResourceForPatternMatching`, the split editor picker, Escape and the aria label (workbench/empty_editor_hint/actions.rs: cargo test -p app the_actions_hint_offers_the_last_picked_editor_first_and_escape_closes_it the_list_fits_the_editor_or_gives_way_to_the_classic_hint; ui-pair port/fixtures/ui-steps/empty-editor-hint.json with the setting on: the same rows, keys and footer) |
| workbench/contrib/commands | workbench contribution | M9 | verified | | runCommands (commands.rs register_run_commands): cargo test -p app commands::, argument checks, spread args, order, stop at a failure; argument errors and the failure notify (cargo test -p app run_commands_argument_errors_notify) |
| workbench/contrib/comments | workbench contribution | M13 | verified | | Done: a reply and an edit form per thread and comment, open together (commentReply.ts per CommentThreadWidget): cargo test -p app two_threads_keep_their_reply_forms_open_together; a zone sized by the drawn comment bodies: cargo test -p app a_wrapped_comment_body_grows_its_zone; next/previous thread and Focus Comment on Current Line focus the thread's comments (`commentFocused`, Up/Down between comments, Escape collapses and selects the range): cargo test -p app the_reached_thread_takes_the_focus. Done in diff editors: glyphs, commenting ranges (asked for every side of every multi diff file), range highlights and zones on both sides of the diff editor and of each multi diff file, the other side aligned by a diagonal fill (workbench/editor_view/diff_editor_view.rs, multi_diff_editor_view.rs, diff_editor.rs `additional_heights`): cargo test -p app diff comment; ui-pair `portComments.openDiff` modified, original and multi. Floating widgets on a diff's original side and on both sides of each multi diff file (comment_thread_floating.rs `FloatingHost`, multi_diff_editor_view.rs `multi_diff_floating_hosts`), with `FloatingWidgetRoom` growing a file below its last line (commentThreadFloatingWidgetRoom.ts, `FileDiff.room`): cargo test -p app floating room multi_diff; ui-pair `portComments.openDiff` original and multi with the floating style. Range decorations (commentThreadRangeDecorator.ts and the floating empty-range line, workbench/comment_thread_widget.rs `comment_range_highlights`): cargo test -p app comment_thread_floating. The floating thread style (`comments.thread.experimental.style: floating`; workbench/comment_thread_floating_layout.rs with commentThreadFloatingWidget.test.ts ported, workbench/comment_thread_floating.rs: placement beside the code or its lines in code order, the outline and connector, title drag, edge resize, double-click reset, the layout kept per thread, wheel to the editor): cargo test -p app comment_thread_floating, ui-pair steps-comment-floating.json (port/results/language-features.md Floating comment threads). Done: the Comments panel (workbench/comments_view.rs: resources, threads with author, relative time, first line, range and replies, the unresolved badge, a markdown preview's images as "Image: {alt}" (cargo test -p app a_markdown_comment_previews_its_first_rendered_block), the filter box with Show Resolved/Unresolved and Sort By, its history in the memento's `filterHistory`, Escape and Cmd+Down while `commentsFilterFocus` (cargo test -p app the_filter_keeps_its_history_and_escape_clears_it; no match highlights, as commentsTreeViewer.ts's renderers ignore the filter data), Collapse/Expand All, row selection and keys; hideIfEmpty; a thread row's `commentsView/commentThread/context` inline actions and context menu with the built-in Reply, which reveals the thread with its zone expanded and reply open: cargo test -p app the_thread_menu_replies_to_the_thread), the gutter glyph that toggles the thread (workbench/editor_view/comment_glyph.rs) and the thread widget (workbench/comment_thread_widget.rs: zone, state colors, head with `comments/commentThread/title` actions and Collapse, markdown comments with `code` spans on no `textCodeBlock.background` (cargo test -p app a_comment_s_code_span_draws_no_code_block_background), reply form with `comments/commentThread/context` buttons and Cmd+Enter), each comment (workbench/comment_node.rs: `comments/comment/title` actions, edit mode with `comments/comment/context` buttons, reactions and their picker), commenting ranges with the add glyph, Add Comment and template threads (workbench/commenting_ranges.rs), the comment commands (workbench/comment_navigation.rs: Collapse/Expand All, Expand Unresolved, Toggle Editor Commenting, Focus Comment on Current Line, Dismiss Comment, next/previous thread, commented range and commenting range, reached at the provider's columns unless it holds the cursor: cargo test -p app a_commenting_range_is_reached_at_its_columns_unless_it_holds_the_cursor) and the comments accessibility help: cargo test -p app comment; ui-pair port/results/language-features.md (Comments, Comment editing and commands); Escape keeps a new template open as the reference does (ui-pair steps-comment-escape-typed.json, cargo test -p app dismissing_a_new_template_keeps_it_open). The reply and edit inputs are code editors (simpleCommentEditor.ts: a `comment`-scheme markdown model, word wrap, no glyph margin, line numbers or folding, `scrollBeyondLastLine` false, 5 to 25 lines by `calculateEditorHeight`) that take the focus with `commentEditorFocused`, Cmd+Enter submits and Escape hides; the host gets the input's document and no text editor (workbench/comment_thread_widget.rs `open_comment_editor`, workbench/editor.rs `comment_editor`): cargo test -p app an_expanded_thread_shows_a_zone_and_replies_run_the_form_actions a_comment_switched_to_editing_runs_the_edit_actions; ui-pair steps-comment-reply-editor.json (reply-empty, reply-lines, reply-grown). Comments panel rows: 4px pane inset, 4px radius and the tree's indent guides as the Problems tree (cargo test -p app rows_sit_in_the_pane_s_inset_with_the_tree_s_indent_and_guides; ui-pair steps-comments.json: chevron, name and thread line at the reference's x and y) |
-| workbench/contrib/customEditor | workbench contribution | M17 | ported | [3 M] custom_editors.rs:637: a custom text editor's resource in two groups shares one webview | Opening a custom text editor with `options.selection` reveals it in the panel and leaves the text model's cursor (cargo test -p app a_custom_text_editor_s_navigation_drives_the_outline); A custom document open in another group moves to the active one, or with `supportsMultipleEditorsPerDocument` gets a second editor there (editorResolverService.ts `moveExistingEditorForResource`: cargo test -p app a_custom_document_open_in_another_group_moves_to_the_active_one a_custom_document_with_multiple_editors_opens_one_more_in_the_active_group); `workbench.editorAssociations` merged as editorResolverService.ts `getAllUserAssociationsForSetting`: the workspace's globs before the default's and user's (cargo test -p app a_workspace_association_wins_over_a_user_one_of_the_same_length); Reopen Editor With puts a closed custom or notebook editor's replacement in its place, pinned (editorGroupView.ts `replaceEditors`: cargo test -p app a_reopened_preview_keeps_its_tab_position); Two default editors for one resource warn once and remember the choice per extension glob (editorResolverService.ts `doHandleConflictingDefaults`: cargo test -p app two_default_editors_for_a_resource_ask_once_which_to_keep); the memento's custom editors until the extensions register (cargo test -p app markdown_editor_files_offer); editor resolution by `workbench.editorAssociations` and contributed selectors (editorResolverService.ts ranks), Reopen Editor With picker (`reopenActiveEditorWith`, `workbench.action.reopenWithEditor`), `_workbench.open`, `_workbench.openWith`; `FIXTURE=custom-editor-tests port/tools/webview-check` 8/8; cargo test -p app custom_editors |
+| workbench/contrib/customEditor | workbench contribution | M17 | verified | | Each editor of a custom text editor's resource, the one opened in another group and a split's copy, has a webview of its own (customEditorInput.ts: cargo test -p app each_group_s_custom_text_editor_has_its_own_webview); Opening a custom text editor with `options.selection` reveals it in the panel and leaves the text model's cursor (cargo test -p app a_custom_text_editor_s_navigation_drives_the_outline); A custom document open in another group moves to the active one, or with `supportsMultipleEditorsPerDocument` gets a second editor there (editorResolverService.ts `moveExistingEditorForResource`: cargo test -p app a_custom_document_open_in_another_group_moves_to_the_active_one a_custom_document_with_multiple_editors_opens_one_more_in_the_active_group); `workbench.editorAssociations` merged as editorResolverService.ts `getAllUserAssociationsForSetting`: the workspace's globs before the default's and user's (cargo test -p app a_workspace_association_wins_over_a_user_one_of_the_same_length); Reopen Editor With puts a closed custom or notebook editor's replacement in its place, pinned (editorGroupView.ts `replaceEditors`: cargo test -p app a_reopened_preview_keeps_its_tab_position); Two default editors for one resource warn once and remember the choice per extension glob (editorResolverService.ts `doHandleConflictingDefaults`: cargo test -p app two_default_editors_for_a_resource_ask_once_which_to_keep); the memento's custom editors until the extensions register (cargo test -p app markdown_editor_files_offer); editor resolution by `workbench.editorAssociations` and contributed selectors (editorResolverService.ts ranks), Reopen Editor With picker (`reopenActiveEditorWith`, `workbench.action.reopenWithEditor`), `_workbench.open`, `_workbench.openWith`; `FIXTURE=custom-editor-tests port/tools/webview-check` 8/8; cargo test -p app custom_editors |
| workbench/contrib/debug | workbench contribution | M16 | ported | [3 L] Disassembly view: not ported <br> [3 L] extensionHost launch type: not ported <br> [3 L] debug hover, inline values: debugHover.ts (`$provideEvaluatableExpression`, evaluate on hover) and the `debug.inlineValues` decorations (`$provideInlineValues`) | ui-pair port/fixtures/debug-node: gutter breakpoint, F5 stops at it, Variables (Local: main), Call Stack with folded deemphasized frames, Breakpoints, Debug Console REPL, toolbar, status bar entry; cargo test -p app debug; Breakpoints header `$(warning)` hint for the debugger's `strings.unverifiedBreakpoints` after breakpointsView.ts's 4s `hintDelayer`, restarted by every breakpoint change (cargo test -p app debug_view; ui-pair port/fixtures/ui-pair/debug/unverified-breakpoints.json with js-debug's unbound math.test.js breakpoint); preLaunchTask, postDebugTask, compound preLaunchTask and the restart tasks through debugTaskRunner.ts's runner with `debug.onTaskErrors`, the remembered task error choice and the slow task notification (cargo test -p app debug_task_runner); Run to Cursor's temporary breakpoint with debugService.ts `runTo`'s 2s verification wait, thread choice from the sessions that verified it, and removal at the next stop or session end (cargo test -p app debug_commands); Debug Console output styled by its SGR sequences with the theme's ANSI colors at contrast 4 (cargo test -p app debug_console debug::ansi); Debug Console filter box (replFilter.ts terms, "Showing N of M" badge, Cmd+F `repl.action.filter`, value and history in workspace storage) and session picker (consoles of the sessions with `hasSeparateRepl`, `mergeWithParent` children in the parent's, selection focuses the session or its stopped child), input history in workspace storage (`debug.repl.history`) (cargo test -p app debug_console); ended sessions stay inactive in the console picker with their output until Clear Console or a start of the same configuration (debugModel.ts `addSession`, repl.ts `sessionsToIgnore`; cargo test -p app an_ended_session_stays_in_the_picker_until_cleared_or_started_again); debugUtils.ts `saveAllBeforeDebugStart` before a start (not for a child session or with `suppressSaveBeforeStart`) and a restart, by `debug.saveBeforeStart` (cargo test -p app a_start_or_restart_saves_the_dirty_editors); triggered breakpoints: debugSession.ts `enableDependentBreakpoints` by `hitBreakpointIds` or the top frame's position sets `sessionsDidTrigger` and sends the files again, continue and the steps wait for it up to 1.5 s (`waitForTriggeredBreakpoints`), a restart clears it (cargo test -p app a_hit_breakpoint_enables_its_dependents); shortcuts in port/notes.md |
| workbench/contrib/dropOrPasteInto | workbench contribution | M13 | verified | | commands.ts `configurePreferredPasteAction`/`configurePreferredDropAction`: the widgets' menus and the Paste As pick open user settings JSON at `editor.pasteAs.preferences` or `editor.dropIntoEditor.preferences` (workbench/paste_edits.rs); the `editor.pasteAs.*` and `editor.dropIntoEditor.*` settings come from core-settings.json; ui-pair paste-menu (port/results/language-features.md) |
| workbench/contrib/editSessions | workbench contribution | | removed | | no sign-in/AI by decision (port/notes.md); not ported |