SysML v2 for Visual Studio Code
A complete modeling environment for SysML v2 and KerML — language intelligence and live, editable diagrams, right inside your editor.
Write SysML v2 and KerML the way you write code — with completion, hover, real diagnostics, refactorings, and go-to-definition — then see and edit your model as a diagram in the native SysML v2 graphical notation. The whole OMG standard library is built in, so import SI::* just works. No Java runtime, no PlantUML, no extra downloads. Everything runs locally and offline.
Why you'll like it
- 🎯 The full language, not a subset — every SysML v2 and KerML construct from the OMG specification, parsed by a real language server.
- 🖼️ Diagrams you can edit — all nine standard views in authentic SysML v2 notation, drawn by a custom SVG pipeline. Drag, resize, add, connect, rename — changes flow back to your source.
- 📚 The OMG standard library, bundled —
Parts, ISQ, SI, Requirements, and the rest resolve out of the box, offline.
- 🧠 Editor intelligence everywhere — context-aware completion, rich hover, a documented diagnostic catalogue with one-click fixes, cross-file rename, and AST-based formatting.
- 🤖 AI-agent ready — server-backed language-model tools let VS Code AI agents reason about your model deterministically.
- 🔒 Private by default — zero telemetry. Nothing about you, your code, or your usage ever leaves your machine.
- ☕ No runtime to install — a pure TypeScript Langium language server. No JDK, no separate generator.
Quick start
- Install the extension. The Get Started with SysML v2 walkthrough opens automatically (or run Welcome: Open Walkthrough…).
- Open or create a
.sysml file. The status bar reads "SysML: ready" once the bundled library is indexed.
- Type
sysml- and pick a scaffold — sysml-part-def, sysml-requirement, sysml-state-machine, and 40+ more.
- Save — diagnostics appear in the Problems panel, and unambiguous cross-package imports are added for you.
- Run
SysML: Show Diagram (or the graph button in the editor title bar) to open the live, editable diagram. Ctrl+Alt+D toggles side / tab mode.
Language intelligence
- Syntax highlighting for
.sysml and .kerml, including quantity literals (1500 [kg]), escaped names ('name with spaces'), and the full operator set (:>, :>>, ::>, **, ??, ===, hastype, as, ->, #( … ), .?, …).
- Smart completion — 45+ snippets, context-aware keyword / member / import / unit completion for every SysML and KerML construct, inline ghost-text suggestions, and signature help for calc / action / constraint calls.
- Hover — element kind, typing, plain-English multiplicity, relationship details, the modeled doc comment, library-function signatures, and a From standard library link straight into the bundled OMG sources.
- Diagnostics — a stable, documented catalogue (LEX / SYN / RES / SEM / SSM / KSM / UNIT / STYL / MIG families) with per-code severity overrides, dimensional analysis of quantity expressions, and a SysML v1 guardrail that maps
block / «stereotype» idioms to their v2 constructs.
- Quick fixes & refactorings — add a missing import,
&&→and, import…as…→alias, add a missing subject, convert def↔usage, extract to a new package, move to a new file, generate a verification case from a requirement, and more.
- Navigation — document outline (
Ctrl+Shift+O), workspace symbols (Ctrl+T), cross-file go-to-definition (into the read-only library too), find references (including satisfy / verify targets), cross-file rename, document highlight, and go-to-declaration for aliases.
- Auto-import on save — unambiguous unqualified cross-package names get their
import added automatically; ambiguous ones open a picker.
- Formatting — AST-based, element-per-line, with author-placed blank lines preserved (uses your
editor.tabSize).
- Semantic tokens & inlay hints — definitions / usages / library symbols get distinct colors (a bundled SysML v2 Default theme is included; semantic highlighting is on by default), plus implicit-multiplicity and opt-in physical-dimension hints.
- CodeLens — N references on requirement defs, Run verification on verification-case defs (evaluates the case and reports pass/fail), and Show diagram on parts, states, actions, and cases.
Live, editable diagrams
A live view of your model in the SysML v2 graphical notation, rendered by a custom SVG pipeline — not PlantUML, no image server. The extension offers only the canvas/table views that actually have content in the file you're looking at, and keeps the Browser View available as a panel.
| View |
Shows |
| General |
definitions and usages, packages with «import» wiring, satisfy / verify / derive links, calc / constraint / view compartments, annotations |
| Interconnection |
directional port stubs, interfaces vs = bindings, item flows |
| Action Flow |
fork / join, decide / merge, send / accept, performer swimlanes |
| State Transition |
composite + parallel states, trigger [guard] / effect, «causation» links |
| Sequence |
activation bars, dashed replies, event occurrences |
| Case |
case ovals with the subject as a linked part box (or a classic v1 system-boundary box), actors as stick figures |
| Geometry |
parts placed on an x/z coordinate frame |
| Grid |
requirements table with satisfy / verify and pass/fail status |
| Browser panel |
the package / membership tree with expand/collapse, open by default in tab mode and toggleable in side mode |
- Editable. A view-specific toolbox at the canvas side adds elements and draws relationships with two clicks — connect, transition, succession, message, include, satisfy — each view offering its own tools. In the Interconnection View, selecting a port also shows a small connector handle beside it; click that handle, then click another port to write a
connect part.port to other.port; relationship back to the source. Drag to rearrange, resize any node, and rename / add / delete elements; changes are applied through the language server with cross-file rename and a syntax-safety re-parse.
- Your layout, your repo. Positions and sizes persist under
.vscode/sysml/diagrams/ — never in the .sysml text — so diagrams are git-friendly and the model stays text-only.
- Theme-aware. Every color adapts to your active VS Code theme (light, dark, high-contrast).
- Side panel or full tab — toolbar, Browser View panel on the left, toggleable properties inspector on the right, minimap, and SVG export. The side columns are resizable; the BV header shows a folder-tree icon plus Browser View in both modes, BV branches can be expanded/collapsed, and BV highlights the elements present on the current diagram. Toggle side/tab with
Ctrl+Alt+D.
- Not sure which view you need? SysML: Which Diagram? recommends one from the question you want answered — and understands the SysML v1 names you already know (bdd, ibd, act, stm, sd, req, uc, pkg, par).
The OMG standard library, built in
The full official model library ships with the extension, so import Parts::*, import ISQ::*, and import SI::* resolve immediately — no separate download, no GitHub clone.
| Layer |
Files |
Examples |
| Systems Library |
21 |
Parts, Ports, Items, Actions, States, Requirements, Constraints, Cases, Views, SysML |
| Kernel Libraries |
3 sub-dirs |
Kernel Data Type / Function / Semantic |
| Domain — Quantities & Units |
~20 |
ISQBase, ISQMechanics, ISQElectromagnetism, SI, SIPrefixes, USCustomaryUnits, … |
| Domain — other |
~10 |
Analysis, Cause & Effect, Geometry, Metadata, Requirement Derivation |
The library loads from a precomputed index at startup, so cold open is fast and nothing is parsed until you need it. Point at your own checkout with sysml.standardLibraryPath — it accepts an unzipped sysml.library/ tree, a .kpar archive, or a directory of .kpar archives. JSON abstract-syntax archives are projected to readable .sysml for indexing.
Works with your AI agents
Seven native VS Code language-model tools let AI agents work with your model through the language server rather than guessing: modeling guidance, document context, draft validation (returns an edit only when it parses clean), standard-library and unit search, symbol resolution, requirement tracing, and diagnostic explanation. The extension bundles no chat UI or model runtime of its own — it makes your existing agents better informed.
Archive & JSON interchange
Open and extract OMG .kpar package archives, and import / export SysML v2 abstract-syntax JSON through generated textual projections — all from the command palette or the Explorer context menu.
Private by default
This extension collects no telemetry and transmits nothing about you, your code, or your usage. There is no analytics SDK, no usage reporting, and no network calls beyond the local language server. That's a deliberate, privacy-first choice.
Reference
Settings
Open Settings → Extensions → SysML v2, or edit settings.json:
| Setting |
Default |
What it does |
sysml.standardLibraryPath |
"" (bundled) |
External sysml.library/ directory, .kpar archive, or directory of .kpar archives to use instead of the bundled one |
sysml.validation.severities |
{} |
Per-code severity overrides, e.g. { "STYL001": "off", "RES009": "error" } |
sysml.diagnostics.unusedImports |
"off" |
Report imports whose members are never referenced (off / warning / error) |
sysml.diagnostics.units |
true |
UNIT001–005 dimensional-analysis checks on quantity expressions |
sysml.editor.autoImportOnSave |
true |
Add missing imports for unambiguous names when saving |
sysml.inlineCompletion.enabled |
true |
Ghost-text inline suggestions |
sysml.inlineCompletion.categories |
[] (all on) |
Opt out of individual inline-suggestion triggers |
sysml.inlayHints.dimension |
false |
Physical-dimension hints after quantity expressions (opt-in) |
sysml.outline.hiddenCategories |
[] |
Hide documentation / representation outline groups |
sysml.workspace.backgroundIndexing |
"imports" |
Background-index unopened files — imports (only files referenced by open files) / off / all |
sysml.preview.diagrams.update |
"on-save" |
When the diagram re-renders (live / on-save / manual) |
sysml.preview.diagrams.defaultKind |
"iv" |
Preferred primary view (gv, iv, afv, stv, sv, cv, gev, grv); Browser View is the BV panel |
sysml.preview.diagrams.defaultMode |
"side" |
Open diagrams as a side panel or a full tab |
sysml.preview.diagrams.showPortLabels |
true |
Port names next to the port stubs |
sysml.preview.diagrams.showMultiplicities |
false |
[1], [0..*] next to usage labels |
sysml.preview.diagrams.showSubjectAsBoundaryBox |
false |
Case View: draw the subject as a v1-style system-boundary box containing its cases |
sysml.preview.diagrams.lineStyle |
"orthogonal" |
Edge routing — orthogonal (square elbows) / straight (direct) / curved |
sysml.trace.server |
"off" |
LSP trace verbosity — messages or verbose for debugging |
Editor behaviour like indent width and format-on-save uses VS Code's built-in editor.* settings. Diagram settings can also be overridden per project in .vscode/sysml/project.json, checked into your repo.
Commands (palette: Ctrl+Shift+P → "SysML:")
- SysML: Show Diagram — open the live, editable diagram
- SysML: Which Diagram? (view guidance) — pick the question you want answered (or the v1 diagram you knew) and the recommended view opens
- SysML: Toggle Diagram Side / Tab Mode (
Ctrl+Alt+D)
- SysML: Restart Language Server
- SysML: Reload Standard Library
- SysML: Open Standard Library Folder
- SysML: Open .kpar Archive
- SysML: Extract .kpar Archive
- SysML: Open Abstract Syntax JSON
- SysML: Export Abstract Syntax JSON
- SysML: Show Syntax Tree
- SysML: Show Diagnostic Reference
- SysML: Report Parse Coverage
Diagnostic codes
Run SysML: Show Diagnostic Reference for the in-editor catalogue. Any code's severity can be overridden with sysml.validation.severities.
| Family |
Codes |
Covers |
| Lexical |
LEX001–LEX009 |
incomplete strings/comments/names, invalid escapes, non-canonical boolean operators, non-ASCII identifiers, trailing whitespace |
| Syntax |
SYN010–SYN102 |
modifier ordering, multiplicity, specialization, expressions, connectors, imports/packages, annotations, behavior, requirements/cases/views, SysML/KerML disjointness |
| Resolution |
RES001–RES016 |
unresolved or ambiguous names, visibility, wrong target kinds, package separators, imports/aliases, unused imports, auto-imports, library shadowing |
| Semantics |
SEM001–SEM010, SSM008–SSM013, KSM002–KSM011, UNIT001–UNIT005 |
modeling heuristics, requirement/case bodies, SysML/KerML well-formedness, dimensional analysis |
| Style |
STYL001–STYL007 |
PascalCase definitions, camelCase usages, requirement docs, indentation, import ordering, recursive wildcards, single-element bodies |
| Migration |
MIG001–MIG002 |
SysML v1 idioms (block, activity, «stereotype») mapped to their v2 constructs with one-click rewrites |
File support
| Extension |
Language |
Notes |
.sysml |
SysML v2 |
Full grammar & services |
.kerml |
KerML |
Shares the grammar (includes the KerML kernel rules) |
.kpar |
OMG package archive |
Open / extract from the command palette or Explorer |
.json |
abstract syntax |
Import as a generated .sysml projection; export from textual models |
Attribution
The bundled sysml.library/ files are taken verbatim from the OMG SysML v2 Release under their LICENSE / LICENSE-GPL, reproduced inside resources/sysml.library/.
Built with Langium and vscode-languageclient.
Issues & feedback
Found a bug or have an idea? Open an issue at https://github.com/voidaliot/sysml-v2-vsc-ext/issues.
| |