Skip to content

VS Code extension: live AADL rendering with WASM #56

@avrabe

Description

@avrabe

Context

All building blocks exist:

  • spar LSP server (spar lsp) for editing support
  • spar-wasm compiles to wasm32-wasip2 (1.3MB)
  • spar-render produces interactive HTML with ports, orthogonal routing, pan/zoom/selection
  • etch HTML wrapper is self-contained (no external deps)

VS Code now supports WASM language servers via wasm-wasi-core.

Proposal

VS Code extension that:

  1. Activates on .aadl files
  2. Runs spar LSP (native binary or WASM) for syntax/diagnostics/go-to-def
  3. Opens a WebviewPanel with live architecture diagram (interactive HTML from etch)
  4. Re-renders on file save (onDidSaveTextDocument)
  5. Supports ?highlight= for click-to-navigate between code and diagram

Architecture options

  • A: Native binary — extension bundles spar binary, shells out for render. Simpler, cross-platform via release binaries
  • B: WASM — loads spar-wasm in VS Code's WASI runtime. No binary distribution needed, but WASI support is newer
  • C: Hybrid — WASM for LSP, native for render (render needs filesystem access)

References

  • VS Code WebviewPanel API
  • VS Code WASM language server support
  • spar-wasm WIT: pulseengine:rivet/renderer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions