The VS Code extension

Every typeCAD/hal project ships with its own editor intelligence. The extension is vendored into the project by create — no marketplace install — and it merges what used to be three separate extensions (typecad-ui, the debugger, and the intel extension) into one.

workflow

Installation

typecad-hal create vendors the built extension into the project's .vscode/extensions/ folder (with a forceInstall entry in .vscode/extensions.json), so opening the project in VS Code is all it takes. Projects pin the experience — no global installs, no version drift between machines.

Example first

terminal
npx @typecad/hal create my-project --target esp32s3_devkitc
code my-project   # the extension is already in .vscode/extensions/
feature

Board-aware diagnostics

The Problems panel is the build's own analysis, not an approximation of it — the extension runs the same engine the CLI does, through the project's installed copy.

Example first

WhatHow it works
Same analysis as the buildSaves run the project's own @typecad/cuttlefish engine in no-emit mode — editor diagnostics can never drift from build diagnostics
Whole import graphPin capabilities, alias conflicts, peripheral ownership, try/catch on no-exception targets — mapped to real ranges with severity icons matching the CLI
Re-analyzes on changeEvery save, and any change to the config, typecad-hal.facts.json, or the board module

Quick-fixes

Diagnostics come with fixes where a fix makes sense:

FixWhat it does
Pin swapA pin-capability error offers a swap to the first capable pin — applied only at pin-argument construction sites, never a blanket rename
Borrow by referenceOwnership fix that promotes the storage keyword and annotates the destination : Shared
Make 'x' constThe other ownership fix, for parts that don't need to move
Drift-safe editsFixes verify the document hasn't changed since the diagnostic — if it has, they skip cleanly instead of mangling the file
feature

Hovers & fact chips

Hover anything hardware-related and the extension answers with facts harvested from the board's silicon — routes, ownership, catalog parts.

Example first

On hoverWhat you see
Your bindingsnew ADC(PA0) reads 'ADC — on PA0' with the harvested silicon routes; pin aliases and bus devices (I2C0.device(0x48)) resolve the same way
Gated classesStore and File show their storage regions, Counter the free hardware counters, Watchdog its wiring
Sensor catalogSENSOR('bme688') resolves against the 200+ part catalog
Claimed pinsShows current usage — 'In this project: ANALOG (ADC 0)'
Board moduleGenerated board.ts exports carry pin facts as JSDoc, so even plain tsserver hovers are board-aware

Construction lines also get inline fact chips — new ADC(PA0) shows ⌁ PA0 · PWM pwm2 ch1 · ADC adc1 ch0 · aliases: BUTTON right after the line. The chips track unsaved edits and skip strings, templates, and comments.

Status bar

The status bar shows the board name with live error/warning counts (blackpill_f401cc · 0E 1W); hover it for memory estimates, async task and ISR counts, and timer usage. Click to re-analyze. A missing engine or config shows an actionable hint instead of silence.

feature

Flash & Monitor

The daily loop is one click: a ▶ Flash & Monitor CodeLens sits on the entry file, and tests get ⚡ Run on Hardware. Both reuse a shared terminal named TypeCAD.

Example first

FeatureBehavior
▶ Flash & MonitorA CodeLens on the entry file — compile, flash, and attach the monitor in the shared "TypeCAD" terminal
⚡ Run on HardwareThe same one-click for test files
Serial port pickerPorts are listed from attached USB devices with manufacturer and VID:PID; the cached choice is re-validated on every use
Re-enumeration wait--monitor waits out the board's post-flash serial re-enumeration (up to 8 s) instead of racing it
feature

.ui language & declarations

The merged extension carries the former typecad-ui language support, plus C++ declaration generation for hand-written native code.

Example first

FeatureWhat it gives you
Syntax highlightingSingle-file .ui components: TypeScript in <script>, CSS in <style>, Svelte-style markup (on:click={handler}, {expressions})
Snippetsscreen, button, bind, signal, canvas, list — and more
Markdown injectionFenced ```ui code blocks highlight inside markdown docs
DeclarationsSaving a .cpp file auto-generates a .d.ts sidecar if missing (never clobbers one); a palette command generates for the active file and opens it
workflow

Source-level debugging

F5 debugs your TypeScript sources natively over GDB on boards with a debug-capable probe method (openocd, jlink — it's in the board facts). launch.json and tasks.json are written at create/build time: the build task compiles and flashes with --debug, and the debug server serves GDB on port 3333.

Example first

debug loop
F5          // build task compiles + flashes with --debug, GDB server on :3333
USB0.writeLine('alive');   // serial print works on every board
reference

Commands

Command IDs keep their historical typecad-intel / typecad-debug prefixes from the pre-merge extensions; the titles all start with TypeCAD:.

Example first

Command IDTitle
typecad-intel.reanalyzeTypeCAD: Re-analyze Project
typecad-intel.flashMonitorTypeCAD: Flash & Monitor
typecad-intel.runTestsTypeCAD: Run Tests on Hardware
typecad-intel.selectPortTypeCAD: Select Serial Port
typecad-debug.generateDeclarationTypeCAD: Generate Declaration from C++
© 2026 typeCAD — code-defined electronics github