Devand — VS Code Extension

An open-source VS Code extension built in Rust. My first serious systems project — a practical excuse to learn Rust's toolchain, FFI, and the VS Code extension API simultaneously.

RustVS CodeExtension APIOpen SourceSystems Programming
2024-02GitHub ↗

Overview

Devand is a VS Code extension — and my entry point into Rust. The goal was straightforward: build something real with Rust, not a toy CLI, but an actual tool with a real distribution channel (the VS Code marketplace) and actual users.

Why Rust for a VS Code Extension?

VS Code extensions run in a Node.js host, not a native binary. The interesting challenge was using Rust for the CPU-intensive parts via WebAssembly (WASM), while the extension's shell and VS Code API calls stayed in TypeScript.

The architecture:

  • TypeScript — VS Code API bindings, command registration, UI
  • Rust → WASM — the computation-heavy logic compiled to WebAssembly via wasm-pack
  • wasm-bindgen — the bridge between Rust types and JavaScript

What It Does

Devand provides developer productivity features focused on code intelligence tooling. The Rust/WASM core handles text processing tasks that would be sluggish in pure JavaScript at scale.

What I Learned

Building this forced me to:

  • Understand Rust's ownership model at the boundary between Rust and JavaScript (ownership can't cross WASM — you copy or serialize)
  • Work with cargo workspaces organizing a multi-crate project
  • Use wasm-pack for the full build-and-bundle pipeline
  • Navigate the VS Code extension API, activation events, and contribution points
  • Package and publish to the VS Code marketplace

The Rust learning curve is infamous. Building something with a concrete distribution goal made getting through it significantly faster.

Open Source

The extension is open source — contributions and issues welcome.


← BACK TO RUST SYSTEMS