Skip to content

Visual Studio Code, rebuilt in Rust

Rust
3.8 KB
Raw Blame

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

How work is tracked

  • port/ledger.md and port/ledger/ are the one source of truth. The Work table holds decisions and milestones with their "done when" checks: the open rows in port/ledger.md, the closed ones in port/ledger/done.md. The Units table, one file per area in port/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.md holds 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.ts checks 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-check for still windows, port/tools/ui-pair for states reached by clicks and keys.
  • An unsafe block 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::all fails without the comment, bun port/tools/docs-check.ts without 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.