SysML v2 VS Code Extension

June 5, 2026 · View on GitHub

A Visual Studio Code extension for SysML v2.0 with syntax highlighting, formatting, validation, navigation, and interactive diagram visualization.

SysML v2.0 VS Code Extension License: MIT

Install from Marketplace Install from Open VSX

Demo

Demo

Features

Language Support (LSP)

All language features are provided by the sysml-v2-lsp language server.

  • Syntax Highlighting — Full support for SysML v2.0 keywords, operators, and constructs via TextMate grammar and semantic tokens
  • Standard Library — Built-in OMG standard library (Kernel, Domain, Systems libraries)
  • Completions — Context-aware auto-complete with trigger characters (., :, space)
  • Hover — Type information and documentation on hover
  • Formatting — Smart indentation and code formatting (document and range)
  • Validation — Real-time syntax and semantic checking with VS Code Problems panel integration
  • Navigation — Go to Definition (including standard library imports), Find References, Document Symbols, Workspace Symbols, Breadcrumbs
  • Rename — Rename symbols with linked editing support across references
  • Code Actions — Quick fixes for common issues
  • Code Lens — Reference counts shown above definitions
  • Folding — Collapsible regions for blocks and nested structures
  • Selection Ranges — Smart expand/shrink selection
  • Signature Help — Parameter hints for action/calc invocations
  • Document Links — Clickable import paths that navigate to the target
  • Type Hierarchy — View supertypes and subtypes of definitions
  • Call Hierarchy — Trace incoming and outgoing action/state invocations
  • Inlay Hints — Inline type annotations next to identifiers (opt-in, off by default)
  • Snippets — 29 code snippets for rapid scaffolding (partdef, part, package, attrdef, portdef, actiondef, statedef, reqdef, enumdef, connect, flow, import, and more)

Tooling

  • Model Explorer — Tree view showing packages and elements across your workspace, with two modes: By File and Semantic Model
  • Feature Explorer — Master-detail tree view showing resolved type information, specialization chains, feature groups (parts, ports, attributes), multiplicity, direction, and modifiers for the selected definition
  • Feature Inspector — Interactive sidebar panel showing detailed type information, specialization breadcrumbs, feature tables with direction/multiplicity/modifier badges, clickable type drill-down, and navigation history
  • Interactive Diagrams — 10 diagram views: General, Interconnection, Action Flow, State Transition, Sequence, Case, Package, Graph, Tree, and Hierarchy — with search, pan, zoom, and PNG/SVG export
  • Model Dashboard — Webview panel displaying model-wide statistics, element counts, build timing metrics, and Model Complexity Index (MCI)
  • Model Complexity Index — Status bar indicator (0–100 score) with hotspot detection for complex elements, documentation coverage, and coupling analysis
  • Animated Parse Progress — Status bar animation showing parse stages (assembling, building, linking) with real-time progress feedback
  • Diagnostic-Reactive Status Bar — Live error/warning counts with colour-coded icons; click to open the Problems panel
  • LSP Server Health — Status bar tooltip showing uptime, memory usage, and cache statistics
  • MCP Server — Built-in Model Context Protocol server for Copilot agent mode integration, enabling AI-assisted SysML modelling

Workspace Support

When you open a multi-root workspace (.code-workspace file), the extension automatically scans all .sysml files across every folder and opens them for the LSP server to parse. This enables:

  • Cross-file navigation — Go to Definition, Find References, and Rename work across all files in the workspace
  • Workspace-wide Model Explorer — The tree view aggregates packages and elements from every file, with two modes:
    • By File — elements grouped under their source file
    • Semantic Model — a unified view merging all packages into a single model tree
  • Background pre-parsing — configurable via sysml.workspace.preloadOnOpen (default: workspaceOnly)
  • Exclude patterns — skip directories from scanning via sysml.workspace.excludePatterns (e.g. temp, archive)

For single-folder workspaces, files are parsed lazily when opened.

Screenshots

General
General View
Interconnection
Interconnection View
Action Flow
Action Flow View
State Transition
State Transition View
Hierarchy
Hierarchy View
Graph
Graph View
Tree
Tree View

Installation

Install from the VS Code Marketplace or the Open VSX Registry (for VS Code-compatible editors such as VSCodium, AWS Kiro, and other Eclipse Theia-based IDEs):

  1. Open the Extensions panel (Ctrl+Shift+X)
  2. Search for "SysML v2"
  3. Click Install

Or install manually from .vsix: Extensions → ⋯ → Install from VSIX

Usage

Create .sysml or .kerml files — the extension activates automatically and provides full language support for both:

package MySystem {
    part def Vehicle {
        attribute mass : Real;
    }
    part car : Vehicle;
}

Commands (Ctrl+Shift+P)

CommandDescription
SysML: Show Model VisualizerOpen interactive diagram for the current file
SysML: Show Model ExplorerOpen the tree view showing packages and elements
SysML: Validate SysML ModelRun validation on the current file
SysML: Format SysML DocumentFormat the current SysML file
SysML: Export Visualization (PNG/SVG)Export the current diagram as PNG or SVG
SysML: Change Visualizer ViewSwitch between diagram views (General, IBD, Activity, etc.)
SysML: Refresh VisualizationRe-render the current diagram
SysML: Jump to DefinitionNavigate to the definition of the symbol under cursor
SysML: Show Type HierarchyView supertypes and subtypes of the current definition
SysML: Show Call HierarchyTrace incoming and outgoing action/state invocations
SysML: Show Feature InspectorInspect attributes, types, and relationships of an element
SysML: Show Model DashboardView model statistics, build timing, and complexity index
SysML: Clear Parse CacheFlush server caches and re-parse the active file
SysML: Refresh Model TreeRefresh the Model Explorer tree view
SysML: Toggle View: By File / Semantic ModelSwitch Model Explorer between file and semantic views
SysML: Restart Language ServerRestart the SysML LSP server

Context Menu

Right-click any folder in the Explorer → Visualise with SysML to aggregate and visualize all .sysml files in that folder. Choose Visualise with SysML (Choose View) to pick a specific diagram type.

Right-click in a SysML file editor → Show Feature Inspector to inspect the element at the cursor.

Right-click a .sysml file or folder → Show Model Dashboard for statistics and complexity analysis.

Right-click a package node in the SysML Model ExplorerVisualize Package to open an isolated diagram for that package.

Settings

SettingDefaultDescription
sysml.validation.enabledtrueEnable SysML model validation
sysml.format.indentSize4Number of spaces for indentation
sysml.visualization.defaultView"sysml"Default view when opening the visualizer (sysml, tree, elk, bdd, package, ibd, graph, hierarchy, sequence, activity, state, usecase)
sysml.export.defaultScale2Default scale factor for PNG exports (1x–4x)
sysml.library.path""Path to SysML v2 standard library directory
sysml.maxNumberOfProblems100Maximum number of problems reported per file
sysml.inlayHints.enabledfalseEnable inlay hints (inline type annotations). May interfere with renaming — disable if you experience editing issues
sysml.workspace.preloadOnOpen"workspaceOnly"Control workspace pre-parsing: always, workspaceOnly, never
sysml.workspace.excludePatterns[]Glob patterns to exclude from workspace pre-parsing
sysmlLanguageServer.trace.server"off"Traces communication between VS Code and the language server (off, messages, verbose)

Development

npm install && npm run compile && npm test

Note for when packaged as a VSIX, the extension registers its MCP server from the extension install path at activation time. A workspace .vscode/mcp.json is only a local development override (for example, to pin Copilot chat to a specific local server build).

Running in the browser (vscode.dev)

The extension also runs as a web extension in browser-based VS Code such as vscode.dev and github.dev. In the web build the language server runs as a Web Worker (via vscode-languageclient/browser) with the SysML standard library bundled in, so there is no Node.js dependency. The desktop build is unchanged and still runs the server as a Node module over IPC.

make web        # build the web bundle and serve it locally like vscode.dev
make test-web   # run the web integration tests in a headless browser host

make web serves on port 3000 by default (override with WEB_PORT, e.g. make web WEB_PORT=3111) and opens the samples/ folder as the workspace. Under the hood these wrap @vscode/test-web and the npm run build:web / npm run test:web scripts. The MCP server is desktop-only and is automatically skipped in the web host.

License

MIT