Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(extensions): veto extension host stops like stopExtensionHosts

rokartur47c9067e3274
diff --git a/README.md b/README.md
index fc25a86e9a6..2eb791d86d2 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,8 @@ Coverage of VS Code 1.147.0, from [port/ledger.md](port/ledger.md) (584 rows). V
```mermaid
pie showData
- "verified" : 416
- "ported" : 14
+ "verified" : 417
+ "ported" : 13
"removed" : 126
"n/a" : 28
```
@@ -23,7 +23,7 @@ pie showData
| workbench contribution | 65 | 3 | 30 | 3 | `███████████████████░ 96%` |
| built-in extension | 88 | 1 | 6 | 0 | `████████████████████ 99%` |
| MainThread* shape (Rust side) | 58 | 1 | 30 | 0 | `████████████████████ 98%` |
-| workbench service | 58 | 7 | 23 | 7 | `██████████████████░░ 89%` |
+| workbench service | 59 | 6 | 23 | 7 | `██████████████████░░ 91%` |
| src/vs/editor/contrib | 54 | 0 | 2 | 1 | `████████████████████ 100%` |
| workbench part | 10 | 1 | 2 | 0 | `██████████████████░░ 91%` |
| extension host seam | 7 | 0 | 0 | 0 | `████████████████████ 100%` |
@@ -31,7 +31,7 @@ pie showData
| src/vs/editor | 1 | 1 | 1 | 1 | `██████████░░░░░░░░░░ 50%` |
| src/vs/base | 0 | 0 | 2 | 3 | `████████████████████ 100%` |
| port feature | 1 | 0 | 0 | 0 | `████████████████████ 100%` |
-| **all** | **416** | **14** | **126** | **28** | `███████████████████░ 97%` |
+| **all** | **417** | **13** | **126** | **28** | `███████████████████░ 97%` |
<!-- coverage:end -->
`removed` are parts left out by decision: AI features, Microsoft services, telemetry, remote and tunnels ([port/notes.md](port/notes.md)). `n/a` are upstream test infrastructure and the Electron process, IPC and DOM layers the native architecture replaces.
diff --git a/native/crates/app/src/workbench/custom_documents.rs b/native/crates/app/src/workbench/custom_documents.rs
index f931ae392d1..44816fd31b6 100644
--- a/native/crates/app/src/workbench/custom_documents.rs
+++ b/native/crates/app/src/workbench/custom_documents.rs
@@ -26,7 +26,7 @@ pub(super) const CUSTOM_EDITOR_SCHEME: &str = "vscode-custom-editor";
pub(in crate::workbench) struct CustomDocument {
pub(super) resource: Value,
pub(super) view_type: String,
- editable: bool,
+ pub(super) editable: bool,
edits: Vec<i64>,
current_edit_index: isize,
save_point: isize,
diff --git a/native/crates/app/src/workbench/extension_host_restart.rs b/native/crates/app/src/workbench/extension_host_restart.rs
index 9abc1089421..39158409512 100644
--- a/native/crates/app/src/workbench/extension_host_restart.rs
+++ b/native/crates/app/src/workbench/extension_host_restart.rs
@@ -15,10 +15,11 @@ use exthost::session::ForwardedRequest;
use exthost::Runtime;
use futures::StreamExt;
use futures::channel::mpsc::{UnboundedReceiver, unbounded};
-use gpui::{App, Context, Window};
+use gpui::{App, Context, PromptLevel, Task, Window};
use serde_json::{Value, json};
use super::Workbench;
+use super::host_requests::uri_parts;
use crate::commands::Outcome;
use crate::host_sync::HostSync;
use crate::main_thread::{HostRequest, WorkbenchMainThread};
@@ -28,15 +29,70 @@ use crate::markers::ReadOptions;
impl Workbench {
pub(super) fn register_extension_host_commands(&mut self) {
self.commands.register("workbench.action.restartExtensionHost", |workbench, _, window, cx| {
- workbench.restart_extension_host(window, cx);
+ workbench.restart_extension_host("An explicit request", window, cx);
Outcome::done()
});
}
- /// `stopExtensionHosts` then `startExtensionHosts`, with the user extensions of the current profile.
- pub(crate) fn restart_extension_host(&mut self, window: &mut Window, cx: &mut Context<Self>) {
- self.stop_extension_host(cx);
- self.start_extension_hosts(window, cx);
+ /// `stopExtensionHosts` then, unless vetoed, `startExtensionHosts`, with the user extensions of the current profile.
+ pub(crate) fn restart_extension_host(&mut self, reason: &str, window: &mut Window, cx: &mut Context<Self>) {
+ let stopped = self.stop_extension_hosts(reason, window, cx);
+ cx.spawn_in(window, async move |workbench, cx| {
+ if stopped.await {
+ let _ = workbench.update_in(cx, |workbench, window, cx| workbench.start_extension_hosts(window, cx));
+ }
+ })
+ .detach();
+ }
+
+ /// abstractExtensionService.ts `_doStopExtensionHostsWithVeto`: the `onWillStop` listeners veto, a veto asks to
+ /// restart anyway; true when the host stopped.
+ pub(crate) fn stop_extension_hosts(&mut self, reason: &str, window: &mut Window, cx: &mut Context<Self>) -> Task<bool> {
+ let mut vetoes = Vec::new();
+ // debugService.ts
+ if !self.debug.sessions.is_empty() {
+ vetoes.push("A debug session is still running that would terminate.".to_owned());
+ }
+ // mainThreadCustomEditors.ts `MainThreadCustomEditorModel` of an editable document.
+ for document in self.webview_panels.custom_editors.documents.iter().filter(|document| document.editable) {
+ let name = uri_parts(&document.resource).ok().and_then(|(_, path)| path.file_name().map(|name| name.to_string_lossy().into_owned())).unwrap_or_default();
+ vetoes.push(format!("An extension provided editor for '{name}' is still open that would close otherwise."));
+ }
+ // customTextEditorModel.ts
+ for panel in self.webview_panels.panels.iter().filter(|panel| panel.editor.is_some()) {
+ vetoes.push(format!("An extension provided text editor for '{}' is still open that would close otherwise.", panel.title));
+ }
+ // notebookEditorInput.ts: a dirty notebook vetoes unless it saves.
+ let dirty: Vec<String> = self.host.notebooks.models.iter().filter(|model| model.dirty).map(|model| model.uri_string()).collect();
+ let mut saves = Vec::new();
+ for key in dirty {
+ let name = key.rsplit('/').next().unwrap_or_default();
+ let veto = format!("An extension provided notebook for '{name}' could not be saved.");
+ saves.push((self.save_notebook_editor(&key, cx), veto));
+ }
+ let reason = reason.to_owned();
+ cx.spawn_in(window, async move |workbench, cx| {
+ for (saved, veto) in saves {
+ if saved.await != Ok(true) {
+ vetoes.push(veto);
+ }
+ }
+ let mut reasons: Vec<String> = Vec::new();
+ for veto in vetoes {
+ if !reasons.contains(&veto) {
+ reasons.push(veto);
+ }
+ }
+ if !reasons.is_empty() {
+ eprintln!("Extension host was not stopped because of veto (stop reason: {reason}, veto reason: {})", reasons.join(", "));
+ let detail = reasons.join("\n -");
+ let Ok(answer) = workbench.update_in(cx, |_, window, cx| crate::dialog::show_message_box(window, crate::dialog::InTests::Confirm, PromptLevel::Warning, "Please confirm restart of extensions.", Some(&detail), &["Restart Anyway", "Cancel"], None, cx)) else { return false };
+ if !matches!(answer.await, Ok((0, _))) {
+ return false;
+ }
+ }
+ workbench.update(cx, |workbench, cx| workbench.stop_extension_host(cx)).is_ok()
+ })
}
/// `startExtensionHosts`: a new host with the window's extensions to run.
diff --git a/native/crates/app/src/workbench/extension_host_restart/tests.rs b/native/crates/app/src/workbench/extension_host_restart/tests.rs
index cf61a5895e5..1d393d39855 100644
--- a/native/crates/app/src/workbench/extension_host_restart/tests.rs
+++ b/native/crates/app/src/workbench/extension_host_restart/tests.rs
@@ -54,3 +54,38 @@ fn a_host_restart_gives_the_extensions_the_proposals_its_window_allows(cx: &mut
});
assert_eq!(running[0].description["enabledApiProposals"], json!(["activeComment"]));
}
+
+/// abstractExtensionService.ts `_doStopExtensionHostsWithVeto`: a running debug session (debugService.ts `onWillStop`)
+/// vetoes Restart Extension Host; Cancel keeps the host, Restart Anyway stops and starts it.
+#[gpui::test]
+fn a_debug_session_vetoes_the_restart_until_confirmed(cx: &mut TestAppContext) {
+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let theme = load_theme(&[scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap()], "Dark Modern").unwrap();
+ let dir = std::env::temp_dir().join(format!("vsrustium-restart-veto-{}", std::process::id()));
+ let settings = std::sync::Arc::new(std::sync::Mutex::new(config::service::Settings::load(config::registry::Registry::with_extensions(&[]), dir.join("User"), None)));
+ let (sender, receiver) = std::sync::mpsc::channel();
+ let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, Languages::new(&[]), settings, HostSync::new(sender), cx));
+ workbench.update(cx, |workbench, _| {
+ workbench.settings.lock().unwrap().update_value("window.dialogStyle", Some(&json!("custom")), config::service::Target::User, None, &[]).unwrap();
+ workbench.debug.sessions.push(crate::debug::session::Session::new("s".into(), 1, json!({ "name": "Launch", "type": "node", "request": "launch" }), json!({}), None, json!({})));
+ });
+ let restart = |cx: &mut gpui::VisualTestContext| {
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.action.restartExtensionHost", Vec::new(), window, cx)));
+ cx.run_until_parked();
+ };
+ let stopped = || receiver.try_iter().any(|message| message.method == "stopExtensionHost");
+ let answer = |button: usize, cx: &mut gpui::VisualTestContext| {
+ workbench.update(cx, |workbench, cx| {
+ let dialog = &workbench.dialogs[0].dialog;
+ assert_eq!((dialog.message.as_str(), dialog.detail.as_deref()), ("Please confirm restart of extensions.", Some("A debug session is still running that would terminate.")));
+ workbench.close_custom_dialog(button, cx);
+ });
+ cx.run_until_parked();
+ };
+ restart(cx);
+ answer(1, cx);
+ assert!(!stopped(), "a veto keeps the host");
+ restart(cx);
+ answer(0, cx);
+ assert!(stopped());
+}
diff --git a/native/crates/app/src/workbench/user_data_profile.rs b/native/crates/app/src/workbench/user_data_profile.rs
index 4b5e84435a5..c3df7ec1e63 100644
--- a/native/crates/app/src/workbench/user_data_profile.rs
+++ b/native/crates/app/src/workbench/user_data_profile.rs
@@ -303,12 +303,40 @@ impl Workbench {
self.on_did_change_profiles(window, cx);
}
- /// `changeCurrentProfile`: the configuration, keybindings, storage and user extensions move to the profile's
- /// files, and the extension host restarts when the profile or what it shares with the default one changed.
+ /// `changeCurrentProfile`: the extension host stops first when the profile or what it shares with the default one
+ /// changed; a veto keeps the current profile and gives the workspace back to it.
pub(crate) fn change_current_profile(&mut self, profile: Profile, window: &mut Window, cx: &mut Context<Self>) {
+ let Some(state) = &self.user_data_profiles.state else { return };
+ if state.current.id == profile.id && state.current.use_default_flags == profile.use_default_flags {
+ return self.update_current_profile(profile, false, window, cx);
+ }
+ let stopped = self.stop_extension_hosts("Switching to a profile", window, cx);
+ cx.spawn_in(window, async move |workbench, cx| {
+ let stopped = stopped.await;
+ let _ = workbench.update_in(cx, |workbench, window, cx| {
+ if stopped {
+ workbench.update_current_profile(profile, true, window, cx);
+ workbench.profiles_changed(cx);
+ return;
+ }
+ let Some(state) = &workbench.user_data_profiles.state else { return };
+ let (workspace, current) = (state.workspace.clone(), state.current.id.clone());
+ let exists = cx.global::<UserDataProfilesService>().profiles.profiles().iter().any(|profile| profile.id == current);
+ if let Some(workspace) = workspace.filter(|_| exists)
+ && let Err(error) = workbench.edit_profiles(cx, |profiles, storage| profiles.set_profile_for_workspace(&workspace, &current, storage))
+ {
+ workbench.notify_error(error);
+ }
+ });
+ })
+ .detach();
+ }
+
+ /// `updateCurrentProfile`: the configuration, keybindings, storage and user extensions move to the profile's
+ /// files; `restart` starts the stopped extension host again.
+ fn update_current_profile(&mut self, profile: Profile, restart: bool, window: &mut Window, cx: &mut Context<Self>) {
let Some(state) = self.user_data_profiles.state.as_mut() else { return };
let previous = std::mem::replace(&mut state.current, profile.clone());
- let restart = previous.id != profile.id || previous.use_default_flags != profile.use_default_flags;
let window_id = cx.entity_id();
let removed = cx.update_global(|service: &mut UserDataProfilesService, _| {
service.set_window_profile(window_id, Some(&profile));
@@ -340,7 +368,7 @@ impl Workbench {
self.rescan_installed_extensions();
self.configuration_changed(&change, before, cx);
if restart {
- self.restart_extension_host(window, cx);
+ self.start_extension_hosts(window, cx);
}
self.install_template_extensions(window, cx);
}
diff --git a/native/crates/app/src/workbench/workspace_editing.rs b/native/crates/app/src/workbench/workspace_editing.rs
index b84d3e10ebd..e8b8dfa9389 100644
--- a/native/crates/app/src/workbench/workspace_editing.rs
+++ b/native/crates/app/src/workbench/workspace_editing.rs
@@ -165,7 +165,7 @@ impl Workbench {
self.start_file_watcher(cx);
self.sync_settings_watches();
if let Some(window) = window.filter(|_| first_changed && !std::env::args().any(|arg| arg.starts_with("--extensionTestsPath"))) {
- self.restart_extension_host(window, cx);
+ self.restart_extension_host("Changing workspace folders", window, cx);
}
cx.notify();
}
@@ -241,11 +241,21 @@ impl Workbench {
Ok(())
}
- /// nativeWorkspaceEditingService.ts `enterWorkspace`: the extension host stops, the window's configuration,
- /// backups and storage move to the workspace in place (`doEnterWorkspace`, workspacesManagementMainService.ts
- /// `doEnterWorkspace`, `storageService.switch(workspace, true)`), then the host starts again on it.
+ /// nativeWorkspaceEditingService.ts `enterWorkspace`: the extension host stops unless vetoed, the window's
+ /// configuration, backups and storage move to the workspace in place (`doEnterWorkspace`,
+ /// workspacesManagementMainService.ts `doEnterWorkspace`, `storageService.switch(workspace, true)`), then the host
+ /// starts again on it.
fn enter_workspace(&mut self, file: PathBuf, window: &mut Window, cx: &mut Context<Self>) {
- self.stop_extension_host(cx);
+ let stopped = self.stop_extension_hosts("Opening a multi-root workspace", window, cx);
+ cx.spawn_in(window, async move |workbench, cx| {
+ if stopped.await {
+ let _ = workbench.update_in(cx, |workbench, window, cx| workbench.do_enter_workspace(file, window, cx));
+ }
+ })
+ .detach();
+ }
+
+ fn do_enter_workspace(&mut self, file: PathBuf, window: &mut Window, cx: &mut Context<Self>) {
let old_workspace = self.workspace().cloned();
let workspace = Workspace::open(file.clone());
if old_workspace.as_ref().is_some_and(|workspace| workspace.file.is_none())
diff --git a/native/crates/app/src/workbench/workspace_editing/tests.rs b/native/crates/app/src/workbench/workspace_editing/tests.rs
index 07a2dad1660..6c90e6384c8 100644
--- a/native/crates/app/src/workbench/workspace_editing/tests.rs
+++ b/native/crates/app/src/workbench/workspace_editing/tests.rs
@@ -80,6 +80,9 @@ fn adding_a_folder_enters_an_untitled_workspace_in_the_same_window(cx: &mut Test
let added = workbench.update_in(cx, |workbench, window, cx| workbench.add_workspace_folders(vec![(dir.join("b"), None)], None, window, cx));
assert_eq!(added, Ok(()));
+ // The folder change restarts the file watcher, whose thread reports to the test scheduler.
+ cx.executor().allow_parking();
+ cx.run_until_parked();
let (file, folders, title) = workbench.read_with(cx, |workbench, _| {
let workspace = workbench.workspace().unwrap();
(workspace.file.clone(), workspace.folders.iter().map(|folder| folder.path.clone()).collect::<Vec<_>>(), workbench.window_title())
@@ -97,6 +100,7 @@ fn adding_a_folder_enters_an_untitled_workspace_in_the_same_window(cx: &mut Test
let target = dir.join("saved.code-workspace");
workbench.update_in(cx, |workbench, window, cx| workbench.save_workspace_as(target.clone(), window, cx));
+ cx.run_until_parked();
assert_eq!(workbench.read_with(cx, |workbench, _| workbench.workspace().unwrap().file.clone()), Some(target.clone()));
assert_eq!(workbench.read_with(cx, |workbench, _| workbench.window_title()), "saved (Workspace)");
assert!(!untitled.exists(), "entering the saved workspace deletes the untitled one");
diff --git a/native/crates/app/src/workbench/workspace_trust_view.rs b/native/crates/app/src/workbench/workspace_trust_view.rs
index ae3c5e3cd21..3c63e433f4b 100644
--- a/native/crates/app/src/workbench/workspace_trust_view.rs
+++ b/native/crates/app/src/workbench/workspace_trust_view.rs
@@ -204,7 +204,7 @@ impl Workbench {
drop(self.run_extension_jobs(vec![Job::Delta(to_add, Vec::new())], None, cx, |error| error));
}
} else {
- self.restart_extension_host(window, cx);
+ self.restart_extension_host("Changing workspace trust", window, cx);
}
self.configuration_changed(&change, before, cx);
self.schedule_unsupported_settings_markers(cx);
diff --git a/port/ledger.md b/port/ledger.md
index 2da3fb9022e..74bedc0f33f 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -32,7 +32,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,
| Milestones | M15 terminal, tasks, output | done | Integrated terminal (PTY from Rust, VT parser and renderer in GPUI), shell integration, extension terminals and pseudoterminals, tasks and problem matchers, npm/grunt/gulp/jake task providers, external terminal, Output panel and log viewer. Open gaps: the gaps column of its unit rows. | api-tests `terminal.test`, `terminal.shellIntegration.test` and `workspace.tasks.test` pass as in the reference (run with `SHELL=/bin/bash` as the baseline was); `npm: build` task from the fixture runs in a terminal. |
| Milestones | M16 debug and testing | in progress | Debug adapter protocol client, launch.json, breakpoints in the gutter, call stack, variables, watch, debug console, JS debugger (`ms-vscode.js-debug`), Test Explorer and test results. Open gaps: the gaps column of its unit rows. | api-tests `debug.test` and testing cases pass as in the reference; a breakpoint in a Node script from the fixture stops and shows variables. |
| Milestones | M17 webviews and notebooks | in progress | A WKWebView embedded in the GPUI window for webview panels, webview views and custom editors, with the upstream message and resource protocol; Markdown preview, image/media preview, simple browser, editor insets; notebooks (ipynb) with renderers and kernels. Open gaps: the gaps column of its unit rows. | api-tests `webview.test`, `customEditor` and `notebook*.test` cases pass as in the reference; Markdown preview of the fixture README draws next to its source. |
-| Milestones | M18 extensions: install, update, gallery | in progress | Extensions view backed by Open VSX, install/uninstall/update/disable, VSIX install, signature and checksum checks, recommendations, ESM extensions added after startup on Bun, language packs and display language. | Installing an extension from Open VSX activates it without restart (an ESM one included); api-tests `extensions.test` pass as in the reference. PORT_GALLERY=1 port/tools/extensions-check: 6 ok; MOCHA_GREP="vscode server cli" port/tools/api-tests: its one test pending, as in the reference (remote only). |
+| Milestones | M18 extensions: install, update, gallery | done | Extensions view backed by Open VSX, install/uninstall/update/disable, VSIX install, signature and checksum checks, recommendations, ESM extensions added after startup on Bun, language packs and display language. | Installing an extension from Open VSX activates it without restart (an ESM one included); api-tests `extensions.test` pass as in the reference. PORT_GALLERY=1 port/tools/extensions-check: 6 ok; MOCHA_GREP="vscode server cli" port/tools/api-tests: its one test pending, as in the reference (remote only). |
| Milestones | M19 product shell, privacy, accessibility, release | done | Welcome page and walkthroughs, update channel for the port's own builds, relaunch, splash, accessibility (VoiceOver through GPUI's accessibility tree, accessibility signals, high-contrast checks), process explorer and performance views, telemetry inert end to end, packaged and signed `.app`. Open gaps: the gaps column of its unit rows. | The telemetry source search (no telemetry endpoint string reachable) and network capture (zero outbound requests in a 10 min session with no user action) pass; VoiceOver reads the editor line and the Explorer rows; the signed `.app` passes `spctl -a`; benchmark rerun against a packaged reference build. |
| Milestones | M20 parity | in progress | Nothing new; close the gaps the earlier milestones left (the gaps column of the unit rows). Completion check in port-m20-check: api-tests met (318/28/0 in the target's suites, 4/0/0, port/results/api-tests.md); pixel-check met, the remaining differences are the causes in port/results/pixels.md; ledger not met: the `ported` rows, each with its open gaps. Closed in workbench/contrib/comments: comment threads in diff and multi diff editors, floating ones included, with the floating style's `FloatingWidgetRoom`. | `port/tools/api-tests` gives 318/28/0 (folder) and 4/0/0 (workspace): the reference baseline 356/46/0 less the suites and tests of removed features (chat, lm, the integrated browser, `env.remoteName`) (port/results/api-tests-reference.md); pixel-check of every window has no difference beyond anti-aliasing and the causes listed in `port/results/pixels.md`; every ledger row is `verified`, `removed` or `n/a`. |
| Milestones | M20 multi-instance code editor | open | Upstream every diff side, multi diff file side, notebook cell and walkthrough snippet is its own CodeEditorWidget; the port draws one editable code editor per group. Bound to that one instance today: `text_area` (workbench/editor_view.rs) and its `text_area_bounds`, the group's `viewport` (`EditorGroup`, editor.rs), `editor_focus` and its listeners (workbench.rs), `editors.active()` as the target of every editor command, the cursor, find and suggest, IME through `EntityInputHandler for Workbench` (text_input.rs), mouse selection in `editor_lines`, and the content widgets (hover, suggest, parameter hints, zone widgets) placed against that one area. Rows that need it: `workbench/contrib/multiDiffEditor` (its modified sides are read-only, upstream edits them in place); the diff editor's original pane, drawn by hand (`original_pane`, diff_editor_view.rs), which upstream can focus, select and search in; the stacked editors of notebook cells and the Editor Playground (port/notes.md, Stacked code editors), which draw every unfocused model as lines only and leave its rows exposed to the active editor's mouse handling. | N code editors with their own viewport, focus, cursor and widgets render in one group, and a multi diff modified side takes typing and undo. |
@@ -393,7 +393,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/services/environment | workbench service | M10 | verified | | the workbench environment's paths and args as init data and app paths (platform/environment row): port/tools/settings-check environment; environmentService.test.ts reads the browser workbench's URL options (web only); copilotHomeService removed by decision (no AI) |
| workbench/services/extensionManagement | workbench service | M18 | verified | | installVSIX, install from Open VSX, uninstall, Install from VSIX and their errors: PORT_GALLERY=1 port/tools/extensions-check 6 ok; dependencies and pack members of a gallery or VSIX install queued before it: cargo test -p app workbench::extension_management::tests; enablement: cargo test -p app extension_enablement; trusted publishers (`checkForTrustedPublishers` before a gallery install, `extensions.trustedPublishers`, product.json `trustedExtensionPublishers`, Manage Trusted Extension Publishers: workbench/trusted_publishers.rs, cargo test -p app trusted_publishers; ui-pair port/fixtures/ui-steps/trusted-publisher.json against REF=~/Developer/vscode-ref-openvsx: the "Do you trust the publisher "MS-CEINTL"?" dialog matches, 3% of the dialog crop off where the product name rewraps the text) |
| workbench/services/extensionRecommendations | workbench service | M18 | verified | | workspaceExtensionsConfig.ts from `.vscode/` and `.vsrustium/` (`.vsrustium/` wins per key), ignored recommendations: cargo test -p app recommendation; ui-pair port/fixtures/extensions/ui-recommendations.json |
-| workbench/services/extensions | workbench service | M18 | ported | [3 M] extension_host_restart.rs:37, :49: `stopExtensionHosts` fires no `onWillStop` and asks no veto (abstractExtensionService.ts:742), so every restart path (Restart Extension Host, profile switch, trust revoke, first folder change, entering a workspace) stops the host unasked | extensionsProposedApi.ts `enabledApiProposals` filtering with product.json's allow-list and `--enable-proposed-api`, one policy per window (cargo test -p exthost proposed_api, cargo test -p app a_host_restart_gives_the_extensions); `_deltaExtensions` with `_activateAddedExtensionIfNeeded` and configuration defaults: port/tools/extensions-check, exthost-probe --install-vsix/--uninstall; other extension points the workbench reads (icon themes, static status bar items) are read at startup only |
+| workbench/services/extensions | workbench service | M18 | verified | | extensionsProposedApi.ts `enabledApiProposals` filtering with product.json's allow-list and `--enable-proposed-api`, one policy per window (cargo test -p exthost proposed_api, cargo test -p app a_host_restart_gives_the_extensions); `_deltaExtensions` with `_activateAddedExtensionIfNeeded` and configuration defaults: port/tools/extensions-check, exthost-probe --install-vsix/--uninstall; other extension points the workbench reads (icon themes, static status bar items) are read at startup only; extension_host_restart.rs `stopExtensionHosts`: the `onWillStop` vetoes of a debug session, an editable custom editor, a custom text editor and a notebook that does not save, then Please confirm restart of extensions with Restart Anyway: cargo test -p app a_debug_session_vetoes_the_restart_until_confirmed, ui-pair of Restart Extension Host over a dirty a.cdoc (custom-document-tests) |
| workbench/services/files | workbench service | M12 | verified | | the disk provider and watcher client run in process: native/crates/files (disk provider, FSEvents watcher, cargo test -p files); elevatedFileService.ts writeElevated is text_files.rs write_elevated of milestone 8 (port-integrate); 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"), workspace-fs and file system |
| workbench/services/filesConfiguration | workbench service | M8 | verified | | read-only part (`workbench/readonly.rs`): session override commands, `updateReadonly(target, false)` after Save Anyway, `files.readonlyInclude`/`readonlyExclude`/`readonlyFromPermissions`, tab lock badge, edit guards and the read-only message: cargo test -p app readonly, ui-pair ro.txt against the reference (port/notes.md milestone 8); `updateReadonly` fires its change only when the session override changes (`applyReadonly`, cargo test -p app update_readonly_notifies_only_when_the_session_override_changes); auto save part: `computeAutoSaveConfiguration`, `getAutoSaveMode` with reasons, `autoSaveWorkspaceFilesOnly`, `autoSaveWhenNoErrors`, `toggleAutoSave` and File > Auto Save (workbench/auto_save.rs, cargo test -p app auto_save); `files.hotExit` is read by the backup tracker (workbench/services/workingCopy row). Removed with their callers: `updateReadonly` with a custom reason or a resource array (filesConfigurationService.test.ts), called only by chat, inline chat and the issue reporter |
| workbench/services/github | workbench service | M14 | removed | | binds the platform/github clients to sign-in sessions (no sign-in by decision); the anonymous gist read is main_thread_github.rs |
@@ -485,7 +485,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/extensions | workbench contribution | M18 | verified | | Extensions view as view panes (cargo test -p app the_views_are_panes; ui-pair port/fixtures/extensions/ui-view.json), queries, details editor, enablement, updates, badge, Help: Start/Continue/Stop Extension Bisect (services/extensionManagement/browser/extensionBisect.ts: state in the application storage across reloads, bisect-disabled extensions as DisabledByEnvironment in the window and out of the host, the urgent sticky prompt, the default-checked Keep this extension disabled; Report Issue & Continue is out with the removed contrib/issue): cargo test -p app extension_bisect, bisect_finds_the_extension_and_keeps_it_disabled; cargo test -p app extension (extensionsViews.test.ts, extensionQuery.test.ts, extensionEnablementService.test.ts cases); Features tab tables and markdown of extensionFeaturesTab.ts and the registered renderers: cargo test -p app extension_features; Runtime Status Uncaught Errors from `$onExtensionRuntimeError` and Messages: cargo test -p app the_runtime_status_lists_uncaught_errors_and_messages, invalid_contributed, static_entries_need_the_proposal, group_needs_the_proposal, debuggers_merge_by_type_and_keep_the_built_in_values, skipped_menu_contributions_are_extension_messages, contributed_command_messages, invalid_views_and_view_containers_are_extension_messages, invalid_configuration_is_an_extension_message, invalid_json_validation_is_an_extension_message, invalid_colors_and_icons_are_extension_messages, invalid_semantic_token_contributions_are_extension_messages, invalid_problem_patterns_and_matchers_are_extension_messages, invalid_grammars_are_extension_messages, invalid_notebook_contributions_are_extension_messages (the authentication point is out with the removed services/authentication); ui-pair port/fixtures/extensions/ui-view.json (view, search, details) against the reference |
| workbench/contrib/externalTerminal | workbench contribution | M15 | verified | | workbench/external_terminal.rs: Open New External Terminal (`workbench.action.terminal.openNativeConsole`, cmd+shift+c), with several workspace folders after the Select workspace folder pick (cargo test -p app open_native_console_picks_a_folder_in_a_multi_root_workspace); cargo test -p app external_terminal; ui-pair (port/results/terminal.md) |
| workbench/contrib/externalUriOpener | workbench contribution | M12 | verified | | workbench/opener.rs: externalUriOpenerService.ts getRequestedOpener (workbench.externalUriOpeners globs), chooseOpener, "How would you like to open: {0}" picker; no Simple Browser (out of scope); verified at port-m12b-verify: cargo test -p app opener 4/4; Simple Browser is out of scope by decision |
-| workbench/contrib/files | workbench contribution | M12 | ported | [3 S] explorer_actions/tests.rs:846: list_click_settings_change_what_clicks_do failed once ("a single click only selects the folder") in three concurrent `cargo test -p app -- editor:: workbench::` runs, passed in the next three | virtual workspaces (non-file folders): milestone 25; Cmd+V pastes the files another app copied after explorer.confirmPasteNative (explorerView.ts paste listener, fileActions.ts `pasteFileHandler`: cargo test -p app cmd_v_pastes_the_files_finder_copied); Dragged workspace roots reorder before or after a root by the pointer's half, or to the end, with the list.dropBetweenBackground line (explorerViewer.ts `doHandleRootDrop`: cargo test -p app dragging_a_root_reorders_the_workspace_folders; ui-pair dragShot of a three-root workspace, line over a root and below the rows matches); Compact folders off while optimized for a screen reader (explorerView.ts `isCompressionEnabled`: cargo test -p app compacts_single_child_folders_into_one_row); A workspace root that fails to resolve: the single folder's file item of its own resource, the "!" decoration in `list.invalidItemForeground` with "Unable to resolve workspace folder (...)" (explorerViewer.ts `getChildren`, explorerDecorationsProvider.ts: cargo test -p app a_workspace_root_that_fails_to_resolve_is_decorated_with_its_error; ui-pair of a two-root workspace with a missing folder, row and hover match); a copy soft-reverts the target's dirty model, which shows the copied file (workingCopyFileService.ts `doMoveOrCopy`: cargo test -p app a_copy_onto_a_dirty_model_reverts_it_to_the_copied_file); An unreadable folder expands to no children without an error (fileService.ts `toFileStat`: cargo test -p app an_unreadable_folder_expands_to_no_children); Explorer tree read from disk (explorer.rs): folders first, default excludes, click to expand, click opens a file as preview, double click pins, selection follows the active editor; Seti file icons and compareFileNamesDefault sort; workspace folders as roots, first five expanded (cargo test -p app); new file and folder, rename, delete, copy, cut, paste, drag and drop and undo through the working copy file operations (cargo test -p app explorer_actions, file_actions); "Do not ask me again" as the NSAlert suppression checkbox (dialog.rs); the context menu with the items whose commands the port has (port/results/contextmenu.md); tree view state in workspace storage (cargo test -p app view_state); file nesting with the explorerFileNestingTrie.test.ts cases (cargo test -p app nest); copyFilePath, copyRelativeFilePath and revealFileInOS (cargo test -p app copy_path, copied_path_labels); compact folders (cargo test -p app compact, get_context, compressed_navigation); Explorer find (cargo test -p app explorer_find find_filters); Finder drops through ExternalFileImport (cargo test -p app files_dropped_from_finder); explorer.sortOrder and sortOrderLexicographicOptions; explorer.autoReveal; list keyboard commands; the view title actions on hover or focus, revealInExplorer, showActiveFileInExplorer and the other file actions (cargo test -p app view_title_and_file_actions); workbench.action.files.newFile and showOpenedFileInNewWindow (cargo test -p app new_file_creates); Add Folder to Workspace and removeRootFolder (workbench/workspace_editing.rs, ui-pair port/fixtures/ui-pair/m12/workspace-folders.json); the compare commands compareFiles, selectForCompare, compareSelected, compareFileWith, compareWithSaved, compareWithClipboard, compareNewUntitledTextFiles (workbench/file_compare.rs: cargo test -p app file_compare); compare with saved by its chord: ui-pair port/fixtures/ui-pair/m12/compare-saved.json (the modified side has its own editor and cursor, at the first change: cargo test -p app file_compare; left the breadcrumbs editor type picker); Find in Folder..., Open in Integrated/External Terminal (cargo test -p app explorer_actions; ui-pair m12/find-in-folder.json and m12/folder-terminal.json), high contrast list outline (icons.json hc matches); rename, delete, new file and drag and drop with its move confirmation: ui-pair m12/explorer-ops.json matches; `<view id>.focus` of the Explorer panes (cargo test -p app focus_view_commands); the editor placeholders: binary, too large, not found and read errors with their actions (cargo test -p app files_that_do_not_resolve; ui-pair m12/editor-placeholders.json matches); the Open Editors view: pane size limits, group rows, unsaved badge, title actions, row close and dirty actions, drag to groups (cargo test -p app open_editors body_limits_clamp; ui-pair m12/open-editors.json); pinned (sticky) editors and scrolling tab bars, sticky shrink tabs in place with the `m…` label (cargo test -p app sticky pinned_editors tab_scroll; ui-pair m12/tab-scroll.json); Explorer indent guides at the reference x, row hover background, decoration badges at 11px 8px from the end, the Unpin Editor hover again after the tab menu closes (cargo test -p app tree_guides hover unpin_hover; ui-pair m12/explorer-guides.json and m12/pinned-tabs.json match). Differences left (port/notes.md milestone 12, session m12-files-done): a long tooltip breaks one path segment earlier (GPUI's line wrapper), the pin action loses its hover style after Cmd+W until the pointer moves (gpui keyboard modality), a shrink sticky tab with a badge and no room for its name; Open With... (`explorer.openWith`, `explorerResourceAvailableEditorIds`: cargo test -p app open_with_opens_the_resource the_context_menu_selects_the_row); Compare Active File With... from a file it opens itself: ui-pair m12/compare.json, the picker, the diff and the README.md menu match (port/notes.md session compare-fix); `explorerResourceReadonly` and `explorerResourceParentReadOnly` from `isReadonly` (cargo test -p app readonly_keys_follow_the_focused_item_and_its_parent); a failed create as an error notification with Retry, a dropped folder added to the workspace (cargo test -p app a_failed_create_offers a_folder_dropped_on_the_root) |
+| workbench/contrib/files | workbench contribution | M12 | ported | [3 S] explorer_actions/tests.rs:846: list_click_settings_change_what_clicks_do failed once ("a single click only selects the folder") in three concurrent `cargo test -p app -- editor:: workbench::` runs, passed in the next three <br> [3 S] explorer_actions.rs:1359 `confirm` (also editor_status.rs:497) shows GPUI's `Window::prompt`: a Warning confirm lacks the caution icon Electron's message box draws (dialog.rs `show_message_box` draws it) and ignores `window.dialogStyle: custom` | virtual workspaces (non-file folders): milestone 25; Cmd+V pastes the files another app copied after explorer.confirmPasteNative (explorerView.ts paste listener, fileActions.ts `pasteFileHandler`: cargo test -p app cmd_v_pastes_the_files_finder_copied); Dragged workspace roots reorder before or after a root by the pointer's half, or to the end, with the list.dropBetweenBackground line (explorerViewer.ts `doHandleRootDrop`: cargo test -p app dragging_a_root_reorders_the_workspace_folders; ui-pair dragShot of a three-root workspace, line over a root and below the rows matches); Compact folders off while optimized for a screen reader (explorerView.ts `isCompressionEnabled`: cargo test -p app compacts_single_child_folders_into_one_row); A workspace root that fails to resolve: the single folder's file item of its own resource, the "!" decoration in `list.invalidItemForeground` with "Unable to resolve workspace folder (...)" (explorerViewer.ts `getChildren`, explorerDecorationsProvider.ts: cargo test -p app a_workspace_root_that_fails_to_resolve_is_decorated_with_its_error; ui-pair of a two-root workspace with a missing folder, row and hover match); a copy soft-reverts the target's dirty model, which shows the copied file (workingCopyFileService.ts `doMoveOrCopy`: cargo test -p app a_copy_onto_a_dirty_model_reverts_it_to_the_copied_file); An unreadable folder expands to no children without an error (fileService.ts `toFileStat`: cargo test -p app an_unreadable_folder_expands_to_no_children); Explorer tree read from disk (explorer.rs): folders first, default excludes, click to expand, click opens a file as preview, double click pins, selection follows the active editor; Seti file icons and compareFileNamesDefault sort; workspace folders as roots, first five expanded (cargo test -p app); new file and folder, rename, delete, copy, cut, paste, drag and drop and undo through the working copy file operations (cargo test -p app explorer_actions, file_actions); "Do not ask me again" as the NSAlert suppression checkbox (dialog.rs); the context menu with the items whose commands the port has (port/results/contextmenu.md); tree view state in workspace storage (cargo test -p app view_state); file nesting with the explorerFileNestingTrie.test.ts cases (cargo test -p app nest); copyFilePath, copyRelativeFilePath and revealFileInOS (cargo test -p app copy_path, copied_path_labels); compact folders (cargo test -p app compact, get_context, compressed_navigation); Explorer find (cargo test -p app explorer_find find_filters); Finder drops through ExternalFileImport (cargo test -p app files_dropped_from_finder); explorer.sortOrder and sortOrderLexicographicOptions; explorer.autoReveal; list keyboard commands; the view title actions on hover or focus, revealInExplorer, showActiveFileInExplorer and the other file actions (cargo test -p app view_title_and_file_actions); workbench.action.files.newFile and showOpenedFileInNewWindow (cargo test -p app new_file_creates); Add Folder to Workspace and removeRootFolder (workbench/workspace_editing.rs, ui-pair port/fixtures/ui-pair/m12/workspace-folders.json); the compare commands compareFiles, selectForCompare, compareSelected, compareFileWith, compareWithSaved, compareWithClipboard, compareNewUntitledTextFiles (workbench/file_compare.rs: cargo test -p app file_compare); compare with saved by its chord: ui-pair port/fixtures/ui-pair/m12/compare-saved.json (the modified side has its own editor and cursor, at the first change: cargo test -p app file_compare; left the breadcrumbs editor type picker); Find in Folder..., Open in Integrated/External Terminal (cargo test -p app explorer_actions; ui-pair m12/find-in-folder.json and m12/folder-terminal.json), high contrast list outline (icons.json hc matches); rename, delete, new file and drag and drop with its move confirmation: ui-pair m12/explorer-ops.json matches; `<view id>.focus` of the Explorer panes (cargo test -p app focus_view_commands); the editor placeholders: binary, too large, not found and read errors with their actions (cargo test -p app files_that_do_not_resolve; ui-pair m12/editor-placeholders.json matches); the Open Editors view: pane size limits, group rows, unsaved badge, title actions, row close and dirty actions, drag to groups (cargo test -p app open_editors body_limits_clamp; ui-pair m12/open-editors.json); pinned (sticky) editors and scrolling tab bars, sticky shrink tabs in place with the `m…` label (cargo test -p app sticky pinned_editors tab_scroll; ui-pair m12/tab-scroll.json); Explorer indent guides at the reference x, row hover background, decoration badges at 11px 8px from the end, the Unpin Editor hover again after the tab menu closes (cargo test -p app tree_guides hover unpin_hover; ui-pair m12/explorer-guides.json and m12/pinned-tabs.json match). Differences left (port/notes.md milestone 12, session m12-files-done): a long tooltip breaks one path segment earlier (GPUI's line wrapper), the pin action loses its hover style after Cmd+W until the pointer moves (gpui keyboard modality), a shrink sticky tab with a badge and no room for its name; Open With... (`explorer.openWith`, `explorerResourceAvailableEditorIds`: cargo test -p app open_with_opens_the_resource the_context_menu_selects_the_row); Compare Active File With... from a file it opens itself: ui-pair m12/compare.json, the picker, the diff and the README.md menu match (port/notes.md session compare-fix); `explorerResourceReadonly` and `explorerResourceParentReadOnly` from `isReadonly` (cargo test -p app readonly_keys_follow_the_focused_item_and_its_parent); a failed create as an error notification with Retry, a dropped folder added to the workspace (cargo test -p app a_failed_create_offers a_folder_dropped_on_the_root) |
| workbench/contrib/folding | workbench contribution | M8 | verified | | `editor.defaultFoldingRangeProvider` picks among extension `FoldingRangeProvider`s from MainThreadLanguageFeatures (workbench/folding_providers.rs): cargo test -p app folding_providers; the setting's enum lists All and the extensions with code, Programming Languages first (`_updateConfigValues`, config registry.rs: cargo test -p config folding_range); `editor.defaultFoldingRangeProvider` picks among extension `FoldingRangeProvider`s from MainThreadLanguageFeatures (workbench/folding_providers.rs): cargo test -p app folding_providers; the setting's enum is not rebuilt for installed extensions; `editor.defaultFoldingRangeProvider` picks among extension `FoldingRangeProvider`s, which come with mainthread/MainThreadLanguageFeatures (port/notes.md milestone 8) |
| workbench/contrib/format | workbench contribution | M13 | verified | | `editor.defaultFormatter` from the extensions with formatters (config registry `list_default_formatters`), the formatter dialog, notification and Configure Default Formatter pick, Format Document With (workbench/format.rs): cargo test -p app format::, cargo test -p config default_formatter; the `formatter.conflict` Formatting language status with Configure... (cargo test -p app two_formatters_without_a_default) |
| workbench/contrib/git | workbench contribution | M14 | removed | | IGitService and its delegate serve only chat and agent sessions (removed by decision) |