User guide

Model SysML v2 and KerML in VS Code.

Install the extension, open a public sample model, use code-grade language intelligence, and round-trip changes through live diagrams—everything local, with no Java runtime, PlantUML server, or telemetry.

Home  /  User guide

1 Install

Install from the Marketplace or use a standalone VSIX. There is nothing else to install—no Java, PlantUML, diagram server, or cloud account.

Or install a VSIX

If you have a standalone package, run Extensions: Install from VSIX… from the Command Palette (Ctrl/Cmd+Shift+P).

Open a model folder

Open a folder containing .sysml, .kerml, or .kpar files.

Wait for ready

Open a .sysml file and wait until the status bar shows SysML: ready. The bundled library is pre-indexed, so this is fast.

The extension runs entirely on your machine. Source text, diagram side-cars, and project config stay in your repository.

↑ Back to top

2 Open the sample workspace

Clone the public sample repository, then open the folder in VS Code:

git clone https://github.com/voidaliot/sysml-v2-samples.git
code sysml-v2-samples

Start with e-mountainbike.sysml for the broadest tour, or sdv.sysml for a larger vehicle architecture. Smaller drone, flashlight, vehicle, cruise-ship, and robocopter models let you learn one concept at a time.

Explore the text

Use hover, completion, outline, go-to-definition, references, and Problems while the status bar shows SysML: ready.

Ask which view fits

Run SysML: Which Diagram? and choose the engineering question you want to answer.

Round-trip an edit

Move a node or waypoint, then rename or add an element and inspect the resulting source and .vscode/sysml/diagrams/ layout sidecar.

VS Code workspace showing sdv.sysml source alongside a live SysML diagram
The SDV model open beside a live diagram — text on the left stays the single source of truth.
↑ Back to top

3 Core editor workflow

Treat SysML and KerML files like code. Everything below is server-backed and works across your workspace and the read-only bundled standard library.

  • Syntax highlighting works instantly for .sysml and .kerml.
  • Completion offers keywords, snippets, visible symbols, library names, members, and units.
  • Hover shows element kind, typing, multiplicity, documentation, and links to the library source.
  • Diagnostics appear in Problems with stable codes such as RES001, SEM006, UNIT003, and MIG001.
  • Quick fixes handle mechanical rewrites: missing imports, boolean-operator migration, missing requirement subjects, unit suggestions, and SysML v1 idiom migration.
  • Formatting is AST-based and follows your VS Code indentation settings.
  • Navigation: go to definition, find references, rename, document symbols, workspace symbols, document highlight, signature help, and inlay hints.

Useful commands

CommandPurpose
SysML: Show DiagramOpen the live diagram preview for the active model or element.
SysML: Which Diagram? (view guidance)Pick the question you want answered and open the recommended view.
SysML: Toggle Diagram Side / Tab ModeSwitch between the side panel and a full tab (Ctrl+Alt+D).
SysML: Show Diagnostic ReferenceOpen the diagnostic-code catalogue.
SysML: Open Standard Library FolderBrowse the bundled OMG standard-library source.
SysML: Open .kpar ArchiveOpen an OMG package archive as read-only extracted model files.
SysML: Export Abstract Syntax JSONExport the active textual model to OMG abstract-syntax JSON.
↑ Back to top

4 Diagram views

Run SysML: Show Diagram on sdv.sysml. The extension detects which views have content and offers the relevant options. Diagrams render locally on a React Flow canvas.

ViewShows
GeneralDefinitions, packages, usage links, specialization, imports, requirements, metadata, variation, compartments, and quick category filters.
InterconnectionNested parts, ports, connectors, bindings, interfaces, item flows, endpoint docking, and reconnectable connectors.
Action FlowActions, control nodes, send/accept nodes, item flows, final/terminate nodes, and performers.
State TransitionStates, composite and parallel state frames, transitions, guards, effects, exhibit and causation links.
SequenceLifelines, activation bars, messages, payload labels, replies, and event occurrences.
CaseUse, analysis, and verification cases with actors, subjects, includes, specialization, and optional boundary-box presentation.
Geometry2D plan or isometric 3D shape layout from model-declared positions and dimensions.
GridEditable requirements table with documentation, subject, per-attribute columns, constraints, satisfy/verify links, status, and CSV export.
BrowserPackage and membership tree panel with expand/collapse and diagram-element highlighting.

Diagram colors follow the active VS Code theme. Layout state is stored under .vscode/sysml/diagrams/ in the repository, never inside the .sysml source.

Interconnection View for the SDV model
Interconnection View — nested parts, ports, connectors, interfaces, and item flows from the textual model.
Grid View requirements table for the SDV model
Grid View — an editable requirements table with trace links, status, and CSV export.
↑ Back to top

5 Edit diagrams safely

The diagram preview is not just a picture — it sends guarded workspace edits through the language server.

Common actions:

  • Drag and resize nodes.
  • Rename elements with F2 or the toolbar action.
  • Add view-specific elements from the toolbar tools.
  • Draw relationships with two clicks: connect, transition, succession, message, include, satisfy, and other view-specific links.
  • Select connectors, delete them, reconnect endpoints, or adjust waypoints.
  • Export graph views as SVG.
  • Export Grid View as CSV.
!

The text model stays authoritative. If an edit would produce invalid SysML, the server rejects it instead of corrupting the file.

↑ Back to top

6 Standard library

The complete OMG SysML v2 release standard library is bundled and pre-indexed:

  • Systems Library — Parts, Ports, Items, Actions, States, Requirements, Constraints, Cases, Views, SysML.
  • Kernel Libraries — data types, functions, and semantic kernel packages.
  • Domain Libraries — Quantities and Units, Geometry, Analysis, Metadata, Cause and Effect, Requirement Derivation.

sysml.standardLibraryPath can point at an external sysml.library/ source tree, a .kpar archive, or a directory of .kpar archives. Leave it empty to use the bundled library.

↑ Back to top

7 Recommended settings

Open VS Code settings and search for sysml.

SettingDefaultPurpose
sysml.editor.autoImportOnSavetrueAdd missing cross-package imports on save.
sysml.diagnostics.unitstrueEnable quantity and unit diagnostics.
sysml.inlayHints.dimensionfalseShow physical-dimension hints.
sysml.preview.diagrams.defaultKindgvPreferred primary diagram view.
sysml.preview.diagrams.defaultModesideOpen diagrams in side-panel or tab mode.
sysml.preview.diagrams.updateon-saveChoose live, on-save, or manual diagram refresh.
sysml.preview.diagrams.lineStyleorthogonalDefault connector routing style.
sysml.preview.diagrams.syncUsageToDeftrueLet Interconnection structural edits synchronize to typed definitions.
sysml.validation.severities{}Override individual diagnostic severities.

Project teams can check in .vscode/sysml/project.json to set diagram defaults consistently across a repository.

↑ Back to top

8 Troubleshooting

SymptomFix
Language identifier is not SysML.Confirm the file extension is .sysml and select the language manually from the VS Code status bar.
Diagnostics look stale.Run SysML: Restart Language Server.
A diagram view is missing.The active model or selected anchor probably has no content for that view. Run SysML: Which Diagram? (view guidance) to choose the right view for your question.
A standard-library symbol does not resolve.Leave sysml.standardLibraryPath empty to use the bundled pre-indexed library, or verify that your external path points at a valid source tree or .kpar archive.
↑ Back to top