Visual Studio Code, rebuilt in Rust
Contributing to VSRustium
VSRustium is a 1:1 port of VS Code 1.148.0 to Rust and GPUI: the same look, keyboard, mouse, settings, extension API and tests. The port lives in native/ (Rust) and port/ (tools, ledger, notes, patches). Upstream VS Code is a plain checkout of its 1.148.0 tag in upstream/ and is never edited: the few changes the extension host needs are port/patches/*.patch, applied to a build copy, and the port's product settings are port/product.json.
Setup
You need Rust (stable) with cargo-gc 0.2.0 (cargo install cargo-gc --version 0.2.0 --locked), Bun 1.4.5 and Node.js 24 (for VS Code's own install and compile). Every cargo command runs as cargo gc <cmd>: it removes the build artifacts no recent build used, so native/target stays bounded.
git clone --branch 1.148.0 --depth 1 https://github.com/microsoft/vscode upstream
(cd upstream && npx -y [email protected] install && npx -y [email protected] run compile)
bun port/tools/build-exthost
(cd native && cargo gc build --release -p app)
native/target/release/vsrustium
port/tools/package-app (macOS) and port/tools/package-linux make the release app; their headers list the options. Run port/tools/build-exthost again after a change to port/patches/ or port/product.json.
How the code is built
- ARCHITECTURE.md is the map: the crates, the processes, the path of a key and of a frame, and the invariants. Read it first.
- docs/ goes one level deeper per area: the workbench, the editor, the extension host and testing. Its index lists the areas that have no document yet.
- docs/memory-safety.md has the rules for
unsafecode and the inventory of every file that has it. - docs/performance.md has the budgets, the rules for hot paths and the gates.
How work is tracked
port/ledger.mdandport/ledger/are the one source of truth. The Work table holds decisions and milestones with their "done when" checks: the open rows inport/ledger.md, the closed ones inport/ledger/done.md. The Units table, one file per area inport/ledger/units, has one row per upstream folder, with its status, open gaps and the narrowest check that proves it. Search it, it is large:rg -n '^\| workbench/contrib/scm ' port/ledger/units.port/notes.mdholds decisions, traps and findings per milestone, reached from the ledger rows.- A gap leaves its cell, and a row turns
verified, in the commit that closes it.bun port/tools/ledger-check.tschecks that the tables agree.
The bar for a change
- Match upstream 1.148.0: its behavior, look and tests. Cite the upstream file the change follows. A deliberate difference is a decision in
port/notes.md. - A fix comes with a test that fails without it (
port/tools/cargo-test <name>). - A UI change comes with a side-by-side check against VS Code:
port/tools/pixel-checkfor still windows,port/tools/ui-pairfor states reached by clicks and keys. - An
unsafeblock has a// SAFETY:comment and its file a row in the inventory of docs/memory-safety.md.cargo gc clippy -p app -p exthost --all-targets -- -A clippy::allfails without the comment,bun port/tools/docs-check.tswithout the row. - A change to a hot path comes with the numbers of its gate from before and after (docs/performance.md).
- Commits follow Conventional Commits:
fix(titlebar): draw disabled Go Back in disabledForeground. - Markdown: one paragraph per source line, no hard wrapping. UI labels use title-style capitalization, as upstream's.
License
Contributions are licensed under the Apache License 2.0 of the project.