skema-vscode — Visual Architecture Modeling Inside VS Code
The Skema VS Code extension brings the complete reactive architecture modeling suite directly into your IDE. It registers as a native Custom Text Editor for *.skema and **/skema.json files, allowing developers to design C4, ArchiMate, BPMN, and cloud diagrams without ever leaving their editor.
Extension Architecture
┌──────────────────────────────────────────────────────────────┐
│ VS Code Extension Host │
│ • extension.ts (Extension lifecycle & command activation) │
│ • skemaEditorProvider.ts (CustomTextEditorProvider) │
│ • Synchronization with VS Code TextDocument & Undo/Redo │
└──────────────────────────────┬───────────────────────────────┘
│ Bi-Directional postMessage()
┌──────────────────────────────▼───────────────────────────────┐
│ Sandboxed Webview Container │
│ • Local media & asset bundling (media/) │
│ • React Canvas Editor with orthogonal routing & Hanan grid │
│ • Theme synchronization with VS Code editor colors │
└──────────────────────────────────────────────────────────────┘
Key Features
Native File Association: Double-click any *.skema or skema.json file in the VS Code file explorer to open the interactive diagram editor.
VS Code Undo/Redo Integration: Edits on the visual canvas integrate into VS Code's native undo buffer (Ctrl+Z / Ctrl+Y) and mark the file dirty (●).
Theme Matching: Listens to vscode.window.onDidChangeActiveColorTheme to dynamically align Skema's canvas background and syntax tokens with your active VS Code theme (Dark+, Light+, Monokai, Nord, Tokyo Night).
Activity Bar Views: Dedicated sidebar panels for Shape Palettes (skema.sidebar.shapes) and Entity Properties (skema.sidebar.properties).
Development
# In vscode-extension directory
npm install
# Compile TypeScript
npm run compile
# Incremental watch build
npm run watch
Debugging with the Extension Development Host
Open vscode-extension/ in Visual Studio Code.
Press F5 or select Run Extension in the Debug panel.
In the new Extension Development Host window, open any workspace and create or open a test.skema file.
Packaging VSIX
npx @vscode/vsce package
Generates skema-vscode-X.Y.Z.vsix for local sideloading or marketplace publication.