Skip to content

Visual Studio Code, rebuilt in Rust

Rust

chore(port): build the 1.148.0 reference beside the 1.147.0 one

rokartur17e7b71e38ca
diff --git a/port/ledger.md b/port/ledger.md
index 630e3f0cc07..0e5e2d350f7 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -39,7 +39,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,
| 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 | done | Nothing new; close the gaps the earlier milestones left (the gaps column of the unit rows). Third completion check at 99caa36b7ed and again at 2cb63eb702e, fresh release build, 1.147.0 reference: api-tests 318/28/0 in the target's suites and 4/0/0, at 2cb63eb702e 319/27/0 with #49125 run in a focused window (port/results/api-tests.md); pixel-check of the 10 windows in 4 themes has no regression, the differences are the causes in port/results/pixels.md, one new: the reference capture sometimes shows "Activating Extensions..." (file and split hclight); every unit row is `verified`, `removed` or `n/a`. 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 | done | Upstream every diff side, multi diff file side, notebook cell and walkthrough snippet is its own CodeEditorWidget. The port keeps one focused code editor per group bound to `text_area`, `editor_focus`, the input handler and `editors.active()`, as upstream's one focused widget takes the keys; every other code editor of the group keeps its own viewport, text area cells, minimap layout and find widget (code_editors.rs `parked`, `finds`) and draws through `text_area` as an inactive group's editor, with its own hover, color decorators, bracket guides and overview ruler; a press focuses it, a wheel scrolls it. Through it: the diff editor's original side (focus, selection, find), the multi diff file sides (the modified side takes typing and undo, its diff follows), notebook cells and playground snippets. | `cargo test -p app -- a_file_side_is_a_code_editor every_drawn_file_side the_original_side_takes_the_focus_selection_and_find each_group_keeps_its_own_find_widget the_focused_cell_is_the_code_editor unfocused_cell unfocused_snippet the_host_sees_the_code_editors_of_the_rendered_cells part_view::`: 17 passed; port/notes.md milestone 20, Multi-instance code editor |
-| Milestones | M21 uplift to VS Code 1.148.0 | later | Postponed by Artur. Starts after milestones 11 to 20 close on 1.147.0 and after milestone 22; until then every reference, baseline and ui-pair stays on 1.147.0. Plan: `port/plans/uplift-1.147.0-to-1.148.0.md`, short form in `port/notes.md` "VS Code 1.148.0" (`bun port/tools/uplift-diff.ts 1.148.0`, every change triaged; refreshed against the ledger with 17 rows still open). Of about 209,000 changed upstream lines, 6,548 are ported: about 3,500 Rust work, 1,977 lines of grammar data and colorize fixtures, about 770 that arrive with upstream or the reference's extensions, and 308 of the floating comment style, a gap older than the uplift. 100,284 lines are skipped: AI, chat, sessions, agent host, remote, GitHub sign-in, experiments, telemetry and the integrated browser. Every setup step and work item is an `M21 uplift` row below, with its check. Steps: 1) session 1 does the setup rows and milestones 7 to 11. 2) Session 2 does milestones 12 and 14: files, workspace, the remove-folder vetoes and SCM. 3) Session 3 does milestones 13 and 15 to 19. Sessions 2 and 3 can run in parallel after session 1. | The ledger names 1.148.0. Every row the diff touches is `verified`, `removed` or `n/a` again, or keeps its 1.147.0 status where the gap is older than the uplift (the floating comment style). The full check passes against the 1.148.0 reference. |
+| Milestones | M21 uplift to VS Code 1.148.0 | in progress | Postponed by Artur, started 2026-12-01 (session 1). Starts after milestones 11 to 20 close on 1.147.0 and after milestone 22; until then every reference, baseline and ui-pair stays on 1.147.0. Plan: `port/plans/uplift-1.147.0-to-1.148.0.md`, short form in `port/notes.md` "VS Code 1.148.0" (`bun port/tools/uplift-diff.ts 1.148.0`, every change triaged; refreshed against the ledger with 17 rows still open). Of about 209,000 changed upstream lines, 6,548 are ported: about 3,500 Rust work, 1,977 lines of grammar data and colorize fixtures, about 770 that arrive with upstream or the reference's extensions, and 308 of the floating comment style, a gap older than the uplift. 100,284 lines are skipped: AI, chat, sessions, agent host, remote, GitHub sign-in, experiments, telemetry and the integrated browser. Every setup step and work item is an `M21 uplift` row below, with its check. Steps: 1) session 1 does the setup rows and milestones 7 to 11. 2) Session 2 does milestones 12 and 14: files, workspace, the remove-folder vetoes and SCM. 3) Session 3 does milestones 13 and 15 to 19. Sessions 2 and 3 can run in parallel after session 1. | The ledger names 1.148.0. Every row the diff touches is `verified`, `removed` or `n/a` again, or keeps its 1.147.0 status where the gap is older than the uplift (the floating comment style). The full check passes against the 1.148.0 reference. |
| Milestones | M22 split the port from the VS Code tree | done | Artur: `main` holds the Rust port only (`native/`, `port/`, the port's skills, README and licenses) and upstream VS Code is `upstream/` (ignored), checked out detached at the followed tag, never edited; an uplift moves it with `git -C upstream checkout <tag>`. Every build step and tool reads upstream from `upstream/` or the path in `VSCODE_SRC`. Decision (Artur): `main` kept its history: a fast-forward by the port's branch plus one commit that removes the VS Code tree; no orphan commit, no `git filter-repo`, no force-push. Port version: the followed VS Code version is `package.json`'s `version` in `VSCODE_SRC`, which `uplift-diff.ts` reads as its default `from` and package-app as its default `VERSION`; `VERSION` in main.rs (the API version extensions see) repeats it. | Steps 1 and 2 (branch `port-m22-split`): `VSCODE_SRC` resolved by `native/vscode_src.rs` (build scripts of app, diff, files; `env!("VSCODE_SRC")`), `port/tools/vscode-src.sh` and `port/tools/vscode-src.ts`; the dev app root is `VSCODE_SRC` (runtime env over the build's value), the host bundle stays in the checkout's `out-exthost/`; the upstream edits are `port/patches/src-*.patch` (build-exthost, on a copy in `out-exthost/build`) and `extensions-*.patch` (package-app), `port/product.json` is the overlay. Step 3 (branch `port-release`): one commit `git rm`s the VS Code tree (21458 files); `ThirdPartyNotices.txt` ships from `VSCODE_SRC`, `LICENSE.txt` from the repo root; `exthost`'s `proposed_api.rs`, `run-app-check`'s extensions default and the dev host's AMD modules (`build-exthost` links `node_modules` beside `out-exthost` to `VSCODE_SRC`'s) read `VSCODE_SRC`; a Studio mirror of a tree without `src/` links `upstream` to `~/Developer/vscode-ref` (`port/tools/studio`). Step 4: a clean clone builds, tests, packages and passes the full check (the README's Build section at 96b0e476067). `git ls-tree main` holds no upstream file. |
| Milestones | M23 Linux build | in progress | Branch `port-linux` (a Linux build container on the Studio). The app is macOS-only today: 24 files of `native/crates` call AppKit, Foundation, WebKit, Security or Core Foundation directly (objc2, core-foundation, security-framework); GPUI (`native/vendor/wu`) already has its Linux platform (Wayland and X11). Every macOS call goes behind `cfg(target_os = "macos")` with the Linux counterpart VS Code uses there, in the same function where the two are a few lines, in a `platform/linux.rs` beside a `platform/macos.rs` where they are not: webview (WebKitGTK through wry), file dialogs (xdg-desktop-portal, rfd), the application menu (drawn in the window: `window.titleBarStyle`, `window.menuBarVisibility`), clipboard and the find pasteboard (GPUI's), proxy (`http.proxy` and the system proxy via reqwest instead of NSURLSession), secrets (Secret Service, keyring), `code` CLI install (`~/.local/bin`), file watching (inotify, notify), the updater (a download link, as `update.mode` on a tar.gz), and the settings import paths (`~/.config/Code`, `~/.config/Cursor`, `~/.config/VSCodium`). Packaging: `port/tools/package-linux` writes `VSRustium-<version>-linux-<arch>.tar.gz` and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (port/notes.md milestone 23); deb and AppImage after it. Builds in a Linux container on the Studio (`docker`, linux/arm64) for the build and the unit tests; linux-x64 on a GitHub Actions `ubuntu` runner once arm64 is green. | `cargo build --release -p app` and the area tests pass on Linux arm64 and x64; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview under Xvfb or Wayland in the container; `v1.147.0-insider` carries `VSRustium-1.147.0-insider-linux-arm64.tar.gz` and `VSRustium-1.147.0-insider-linux-x64.tar.gz`; the macOS build is unchanged (its area tests and api-tests as before). |
| Milestones | M24 Windows build | in progress | Branch `worktree-m24-windows`, beside milestone 23 on the same seams: macOS and Linux code stays as it is, each Windows counterpart sits behind `cfg(target_os = "windows")` in the function where it is a few lines, in a `windows.rs` beside `macos.rs` and `linux.rs` where it is not. Scope: WebView2, the Win32 file dialogs and message boxes, the in-window menu bar and custom title bar, Credential Manager (keyring), named pipes for the extension host and single instance, ConPTY for the terminal (alacritty_terminal 0.25 has it), drive-letter paths and file URIs, the user-setup install path with `bin` on the user PATH (code.iss `addtopath`), `%APPDATA%\Code` settings import, an x64 and arm64 zip and a user installer, no Authenticode signing (the Windows signing decision). Cross build on the Studio (cargo-xwin, `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc`) for compile checks and host-run unit tests; real runs on GitHub Actions `windows` runners (`.github/workflows/windows.yml`, by hand). Seams: the "M24 Windows" rows. | `cargo build --release -p app` and the area tests pass on win32-x64 and win32-arm64 runners; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview on the runner; `v1.147.0-insider` carries `VSRustium-win32-x64-1.147.0-insider.zip`, `VSRustium-win32-arm64-1.147.0-insider.zip` and both user setups; the macOS and Linux builds are unchanged (their area tests as before). |
@@ -102,7 +102,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,
| M24 Windows | port/tools/package-windows:1 | open | [windows M] `VSRustium-win32-<arch>-<version>.zip` as VS Code's Windows archive lays it out (`<applicationName>.exe`, `bin\<applicationName>.cmd`, `resources\app`, bun.exe), the host's native modules built for Windows, `win32-<arch>-archive.json` feed entries. | the extracted zip passes the smoke on the windows runner |
| M24 Windows | port/tools/windows/code.iss:1 | open | [windows M] user setup (`{userpf}\<dirName>`, `addtopath`, Start menu entry, file associations as code.iss) built with Inno Setup on the runner; unsigned (the Windows signing decision). | the setup installs silently, `<applicationName> --version` runs from a new shell's PATH, uninstall removes it |
| M24 Windows | .github/workflows/windows.yml:1 | open | [windows S] x64 on `windows-latest`, arm64 on `windows-11-arm`, by hand (`workflow_dispatch`), uploading the zips, setups and feed entries. | one dispatched run green for both architectures |
-| M21 uplift | setup: reference | later | On the Studio: check out `1.148.0` in `~/Developer/vscode-ref`, run `npm ci`, compile it and its extensions (port/notes.md "Reference"), then run `port/tools/fetch-builtin-extensions` again. | `~/Developer/vscode-ref/package.json` names 1.148.0 and `port/tools/ref-screenshot` draws it |
+| M21 uplift | setup: reference | done | On the Studio: `~/Developer/vscode-ref-1.148.0`, an APFS copy (`cp -c`) of `~/Developer/vscode-ref` checked out at `1.148.0`, `pnpm install` and `pnpm run compile` (it and its extensions, port/notes.md "Reference"), then `port/tools/fetch-builtin-extensions`. `~/Developer/vscode-ref` stays at 1.147.0 while milestones 16 and 20 verify against it; the reference tools take the new one through `REF` (and `VSCODE_GPUI_EXTENSIONS` where they default to the old one's extensions). The GUI VMs share only `~/Developer/vscode-ref`, so 1.148.0 GUI runs need the host lane. | `~/Developer/vscode-ref-1.148.0/package.json` names 1.148.0; `REF=~/Developer/vscode-ref-1.148.0 port/tools/ref-screenshot /tmp/m21-ref dark` draws the empty workbench (2026-12-01) |
| M21 uplift | setup: upstream checkout | later | `git -C upstream fetch origin tag 1.148.0 --no-tags`, then `git -C upstream checkout 1.148.0` (1.148.0 is not a descendant of 1.147.0: each release is its own branch). 1.148.0 does not change the files that the 9 `port/patches/*.patch` and the `product.json` overlay touch. Rebuild the extension host. | `git -C upstream apply --check port/patches/*.patch`; `port/tools/build-exthost` |
| M21 uplift | setup: proxy ids | later | 1.148.0 appends `MainThreadRemoteAgentHosts` to `MainContext`, so every `ExtHostContext` id after it moves by one: rerun `bun port/tools/gen-proxy-ids.ts`. The port answers the new proxy as inert, the same as the other removed agent proxies. | `cargo test -p exthost`; exthost-probe 30/30 on Bun and Node |
| M21 uplift | setup: reference dumps | later | Rerun `port/tools/dump-settings`, `ref-commands`, `ref-contextmenu`, `ref-menubar`, `ref-hover` and `ref-dom`. They bring in without code: `workbench.editor.newTabButton` (renamed from `workbench.editor.experimental.newTabButton`), the removed `multiDiffEditor.experimental.fileList`, the new `update.enableEarlyStaging`, `markdown.editor.initialMode` and `workbench.editor.experimental.emptyEditorHintOpenInMarkdownEditor`. | `port/tools/settings-check` lists the new settings and not the removed one |
diff --git a/port/notes.md b/port/notes.md
index a2fe2321cd1..9ba9fa47338 100644
--- a/port/notes.md
+++ b/port/notes.md
@@ -5,11 +5,11 @@ Decisions, traps and findings that the ledger rows point to. Newest at the end o
## Layout
- `native/`: Cargo workspace. `crates/exthost` (framing, RPC, handshake, init data, session dispatcher, `exthost-probe` binary), `crates/app` (`code-gpui`, the GPUI app).
-- `upstream/` (not committed, milestone 22): VS Code checked out at the 1.147.0 tag, never edited; every build step and tool reads it through `VSCODE_SRC` (default `upstream/`; `native/vscode_src.rs`, `port/tools/vscode-src.sh`, `port/tools/vscode-src.ts`). Setup and build: README.md. A Studio mirror without its own `upstream/` gets a link to `~/Developer/vscode-ref` (`port/tools/studio`).
+- `upstream/` (not committed, milestone 22): VS Code checked out at the 1.147.0 tag, never edited; every build step and tool reads it through `VSCODE_SRC` (default `upstream/`; `native/vscode_src.rs`, `port/tools/vscode-src.sh`, `port/tools/vscode-src.ts`). Setup and build: README.md. A Studio mirror without its own `upstream/` gets a link to `~/Developer/vscode-ref-1.148.0` (`port/tools/studio`).
- `src/bootstrap-exthost.ts` (added by `port/patches/src-bootstrap-exthost.patch`): entry of the extension host bundle (`port/tools/build-exthost` writes `out-exthost/bootstrap-exthost.js`). Same bundle on Bun and Node.
- Upstream edits (milestone 22) are `port/patches/*.patch` against the 1.147.0 tag, never committed to upstream: `build-exthost` applies `src-*.patch` to a copy of `src/` in `out-exthost/build` and inlines product.json with `port/product.json` (the port's name, data folder, bundle id, URL protocol) over it; `package-app` applies `extensions-*.patch` to the bundled extensions and writes the merged product.json; `product.rs` merges `port/product.json` at startup. A patch is regenerated by editing the file in `upstream/` and `git -C upstream diff -- <file>`, then `git -C upstream checkout -- <file>`.
- `port/tools/studio <cmd>`: syncs the tree to the Mac Studio (`~/Developer/vscode-gpui-work/port-src`) and runs `<cmd>` there. All builds and runs go through it.
-- Reference: untouched 1.147.0 checkout at `~/Developer/vscode-ref` on the Studio (compiled, extensions compiled). Wu `a3ced28` at `~/Developer/wu`.
+- Reference: untouched 1.148.0 checkout at `~/Developer/vscode-ref-1.148.0` on the Studio (compiled, extensions compiled; the tools take it through `REF`); `~/Developer/vscode-ref` stays the 1.147.0 one until milestones 16 and 20 close on it. Wu `a3ced28` at `~/Developer/wu`.
## Extension host seam
diff --git a/port/tools/studio b/port/tools/studio
index 0451a1cd95b..8e4d812a77c 100755
--- a/port/tools/studio
+++ b/port/tools/studio
@@ -29,8 +29,8 @@ stale=$(mktemp)
trap 'rm -f "$stale" "$sync_lock"' EXIT
# A mirror without alternates still has the full .git of the old rsync copy: replace it with a light one.
# A mixed reset moves only the index, so file mtimes and the cargo build stay as they are.
-# A mirror of a tree without src/ (split, milestone 22) reads upstream from the Studio's 1.147.0 reference: upstream -> ~/Developer/vscode-ref.
-ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -e upstream || ln -s ~/Developer/vscode-ref upstream; } && git ls-files -m -z'" > "$stale"
+# A mirror of a tree without src/ (split, milestone 22) reads upstream from the Studio's 1.148.0 reference: upstream -> ~/Developer/vscode-ref-1.148.0.
+ssh studio "cd ~/$work/$name && bash -c 'test -f .git/objects/info/alternates || { rm -rf .git && git init -q && echo ~/$work/git.git/objects > .git/objects/info/alternates; }; git reset -q $head && git clean -fdq && { git cat-file -e HEAD:src 2>/dev/null || test -e upstream || ln -s ~/Developer/vscode-ref-1.148.0 upstream; } && git ls-files -m -z'" > "$stale"
# Diff against HEAD, not the index: staged changes (a merge being resolved) must travel too.
# openrsync has no --ignore-missing-args: leave out files deleted here.
cat "$stale" <(git diff --name-only -z --diff-filter=d HEAD) <(git ls-files -o --exclude-standard -z) | sort -zu | { grep -zvxFf <(git -c core.quotepath=off diff --name-only --diff-filter=D HEAD) || true; } | rsync -az --from0 --files-from=- . "studio:$work/$name/"