Aliot SysML v2

Aliot SysML v2 User Guide

This guide explains how to use the SysML v2 VS Code extension to author and navigate SysML v2 and KerML models.


1. What is SysML v2?

SysML v2 (Systems Modeling Language version 2) is an OMG standard for model-based systems engineering (MBSE). It defines a textual notation that lets you describe a system's structure, behavior, requirements, and verification cases in plain-text files that can be version-controlled, reviewed, and generated from.

KerML (Kernel Modeling Language) is the semantic foundation that SysML v2 is built on. You generally author models in SysML; KerML is relevant if you are working close to the metamodel or building tooling.

Aliot supports both languages with their own file extensions:


2. Getting Started

Opening a model file

Install Aliot SysML v2 from the Visual Studio Marketplace. Choose Aliot Light or Aliot Dark with Preferences: Color Theme.

  1. Open VS Code and load a folder that contains .sysml files, or create a new file with the .sysml extension.
  2. The extension activates automatically when VS Code detects a .sysml or .kerml file in the workspace.
  3. Check the bottom-right status bar. it should show SysML (or KerML) as the language identifier.

Running the examples

Download a model from the public SysML samples repository:

Open either model to see syntax highlighting in action:

Restarting the language server

If the language server stops responding, run SysML: Restart Language Server from the Command Palette (Ctrl+Shift+P).

Try Properties editing

Download the delivery drone model and open it in VS Code. These pictures show Aliot running in VS Code.

  1. Open the diagram for the drone part. Choose Interconnection View, orthogonal lines and Fit.
  2. Select battery. Open Properties with the rightmost toolbar button, then expand Inherited.
  3. Change capacity from 80 to 95. Press Enter or use the check icon to apply.
  4. Inspect the source. A local attribute :>> capacity = 95; now belongs to this battery. The Battery definition and spareBattery still use 80.
  5. Use native Undo to reverse the edit. Escape cancels an unapplied draft. Clearing the local override restores the inherited value.

Battery Properties after applying a local capacity override.

Inspect powerOutput to see inherited voltage and current members, the calculated direction and the Conjugated control. Use a member row's arrow to inspect its details, then Back to return. Choose Open declaration when you intend to edit the shared definition.

Compare the before and after Properties captures to see the applied local override.

  1. Open Browser with the leftmost toolbar button. Expand drone to find propulsion.
  2. Click the Diagram pill on propulsion to open its diagrams. Choose Interconnection View to see the four motors and their command connections.
  3. Use Up beside the Browser filter to return to the parent's General View. This clears the Browser filters. Up is disabled at the file root.
  4. Select a Browser row to inspect its Properties. Use its Diagram pill when you want to change the diagram's root.

Browser and Interconnection View focused on the propulsion subsystem.

See the hierarchy sequence or download the model after editing to compare the source.


3. Core Language Concepts

Packages

Every model is organised into packages. A package is a named namespace:

package VehicleModel {
    // definitions and usages go here
}

Packages can be nested, and you import from other packages with import:

private import ScalarValues::*;    // import everything from ScalarValues
import ISQ::MassValue;             // import a single type

Definitions vs. Usages

The most important concept in SysML v2 is the Definition / Usage split:

// Definition. reusable type
part def Battery {
    port supply : PowerOutPort;
}

// Usage. Battery is used inside Flashlight
part def Flashlight {
    part battery : Battery;   // usage
}

Think of definitions as classes and usages as fields/properties.

Specialization and Typing

Syntax Meaning
part def X :> Y X specialises (inherits from) Y
part def X :>> feature X redefines a feature inherited from its parent
part x : Y usage x is typed by definition Y
port def P :> ~Q P is the conjugate of Q (port direction is flipped)

Modifiers

Modifiers appear before the element kind keyword:

abstract part def Vehicle { ... }
constant attribute mass : MassValue;
in  port input  : DataInPort;
out port output : DataOutPort;

Common modifiers: abstract, variation, variant, derived, constant, ref, in, out, inout.


4. Writing Your First Model

Create a file my-model.sysml:

package MySystem {

    private import ScalarValues::*;

    // -- Types --

    item def Signal;

    port def SensorOutPort {
        out data : Signal;
    }

    port def SensorInPort :> ~SensorOutPort;

    // -- Components --

    part def Sensor {
        port out : SensorOutPort;
    }

    part def Processor {
        port in : SensorInPort;
    }

    // -- System assembly --

    part def System {
        part sensor    : Sensor;
        part processor : Processor;

        connect sensor.out to processor.in;
    }
}

Save the file. Syntax highlighting applies immediately, diagnostics appear in the Problems panel, undefined names are underlined with quick fixes, and SysML: Show Diagram renders the system. try the Interconnection View on System.


5. The Flashlight Example Explained

The file flashlight.sysml is the compact end-to-end demo. Here is a section-by-section walkthrough.

5.1 Package and imports

package FlashlightModel {
    private import ScalarValues::*;
    private import ISQ::*;
    private import SI::*;

ScalarValues, ISQ, and SI are SysML v2 standard library packages. They supply typed attribute types like VoltageValue, LuminousIntensityValue, and unit literals like [cd] (candela).

5.2 Items. things that flow

item def Light;
item def Electricity;

item def declares the kinds of physical or information payload that can flow through ports and connections.

5.3 Port definitions

port def PowerOutPort {
    out current : Electricity;
}

port def PowerInPort :> ~PowerOutPort;   // conjugate

PowerInPort is declared as the conjugate of PowerOutPort using ~. Conjugation flips all directional features: an out in the original becomes an in in the conjugate. This is the standard SysML idiom for matching complementary interfaces.

5.4 Part definitions

part def Battery {
    doc /* DC power source. */
    port supply : PowerOutPort;
    attribute capacity : ElectricChargeValue;
    attribute nominalVoltage : VoltageValue;
}

doc /* … */ attaches a documentation comment to the element. attribute declares a typed property.

5.5 System composition

part def Flashlight {
    part battery : Battery;
    part switch  : Switch;
    part bulb    : Bulb;

    connect battery.supply to switch.in;
    connect switch.out     to bulb.supply;

Nested part usages compose the system. connect wires ports together using qualified names (battery.supply).

5.6 State machine

    exhibit state mode {
        state off;
        state on;

        transition pressOn  first off accept signal: PressEvent then on;
        transition pressOff first on  accept signal: PressEvent then off;
    }

exhibit state attaches a state machine to the part. transition declares a labelled arc: starting state (first), trigger (accept signal:), and target state (then).

5.7 Requirements and verification

requirement def MinimumBrightness {
    doc /* The flashlight shall emit at least 50 lumens when on. */
    subject flashlight : Flashlight;
    attribute minLumens : LuminousIntensityValue = 50 [cd];
    require constraint { flashlight.bulb.lumens >= minLumens }
}

part myFlashlight : Flashlight {
    attribute :>> bulb.lumens = 80 [cd];
    satisfy MinimumBrightness;
}

requirement def declares a formal requirement with a subject and a require constraint. satisfy on a usage asserts that the instance meets the requirement. Verification cases (verification def) document the test procedure and use verify to link back to the requirement.


6. Key Language Constructs

Definitions

Keyword Purpose
package Namespace grouping
part def Structural component type
port def Interface / connection point type
item def Payload / flow type
attribute def Typed value type
action def Behaviour step type
state def State machine type
requirement def Formal requirement type
verification def Test / verification procedure type

Usages (inside definitions or other usages)

Keyword Purpose
part Structural member
port Interface member
item Flow instance
attribute Value member
action Behaviour step instance
state State node
connect Port-to-port binding
satisfy Assert requirement satisfaction
verify Assert requirement verification

Multiplicity

part wheels : Wheel[4];       // exactly 4
part passengers : Person[0..5]; // 0 to 5
part sensors : Sensor[*];    // zero or more

Qualified names

Use :: to navigate namespaces:

import ISQ::MassValue;
attribute mass : ISQ::MassValue;

7. Extension Features

Editing

Saving and shared Undo

Diagram edits update the real .sysml and diagram JSON editor buffers. The JSON remains in a normal tab behind the diagram so VS Code includes it in File > Save All (Ctrl+K, then S on Windows). Ctrl+S saves the active document, so use the toolbar Save button (after Redo) or Save All to save both source and layout changes. The toolbar Save uses the normal VS Code save and lights up only while something is unsaved. Save All saves each dirty file; it is not an atomic transaction across files.

Use File > Auto Save to let VS Code save both document types automatically. The normal settings apply:

{
  "files.autoSave": "afterDelay",
  "files.autoSaveDelay": 1000
}

With Auto Save off, JSON changes remain visible in the editor and dirty until saved. VS Code owns save failures and recovery. The extension creates a missing JSON file once, then uses text edits for changes. It does not delete/recreate the file, force each gesture to disk, or run its own save/retry timer. A disk save can still write the whole text file; small editor edits are not a promise of partial SSD writes. See VS Code Save / Auto Save.

Undo and Redo follow native document history. A diagram move joins its JSON edit to the source resource without changing source text. Related source/JSON changes and multi-file semantic edits are grouped workspace edits. The diagram stays active when using its Undo and Redo controls. Reset Layout and Reset Connector Routing use the same history. Rendering after an edit does not create extra geometry edits. Saved presentation changes are undoable. Pan and zoom use durable workspace state. Navigation, automatic routing caches and selection do not add modeling undo steps. Independent manual JSON edits use their native JSON resource history; saving does not combine separate histories.

Inlay hints

Inlay hints show what the model says but the source does not write down. Each category is its own setting under sysml.inlayHints.*, and sysml.inlayHints.enabled turns the lot off in one place.

Setting Default Shows
sysml.inlayHints.enabled on Master switch for everything below.
sysml.inlayHints.multiplicity on The implicit [1] on a usage with no multiplicity.
sysml.inlayHints.dimension off The resolved quantity value type or physical dimension.
sysml.inlayHints.visibility off The implicit private on an import.
sysml.inlayHints.modifiers off The implicit ref on an attribute usage, and the implicit constant on a feature that subsets a constant one.
sysml.inlayHints.redefinition off The parameter a directed parameter redefines by position.
sysml.inlayHints.effectiveNames off The name a feature takes from what it redefines.
sysml.inlayHints.importedNames off The other name a membership import also brings into scope.
sysml.inlayHints.parameterNames off The parameter each positional invocation argument binds to.

Three of them are mechanical enough to write into the source: double-click the private, ref or constant hint and the modifier is inserted where the specification puts it. The rest are read-only, because the text they show is a consequence rather than something you would type. Ctrl+click a redefinition, imported-name or parameter-name hint to open what it names.

Every hint comes from something that actually resolved, so a category stays quiet rather than guessing: a declaration whose type does not resolve gets no redefinition hints. A hint also disappears the moment the source says the same thing itself.

A declaration that writes no specialization still has one. Its keyword fixes a base in the OMG standard library: a bare part def specializes Parts::Part, a bare part subsets Parts::parts, an action def specializes Actions::Action, and so on for every definition and usage family (OMG SysML v2 Part 1 section 7.6.8). The extension derives that base once and reads it everywhere: the hover card lists it beside the relationships the source writes, the type-conformance checks count it, and the abstract-syntax export emits it marked isImplied. There is deliberately no inline hint for it: the base is fixed by the keyword you already typed, so printing it beside the declaration restates the line rather than adding to it. Hover states it when you want it.

The edge stays out of your file. Nothing rewrites the declaration, and the export never writes an implied edge back as source on a round trip. To make it real text, use the light-bulb refactoring Make implicit specialization explicit, which writes :> Parts::Part into the declaration head. It is offered only where the base exists in the loaded library, and it disappears once the declaration states a specialization, so applying it twice does nothing.

An element can carry two names, a regular one and a short one (view def <gv> GeneralView;), and an import brings in both. sysml.inlayHints.importedNames shows the one the path does not write, so import Views::GeneralView; reads import Views::GeneralView; also <gv>. The name is printed the way its declaration writes it, so a short name keeps its angle brackets. An expose path is covered too. It is shown only for a membership path (not Pkg::*), only when the written path names exactly one element, and never when the import states its own as alias.

sysml.inlayHints.parameterNames names positional arguments: Add(1, 2) reads Add(x = 1, y = 2). An argument that already writes x = 1 is left alone, and the arrow form counts from the second parameter because the target fills the first (x->select{…} is select(x, …)). A new Type(…) is named from the type's own public features, in order, which is what a constructor binds.

The implicit constant follows KerML: a feature that subsets or redefines a constant feature is itself constant. It is shown only where the feature can vary at all, which means inside a part, item, action, connection or other occurrence-kind owner, KerML class, struct and behavior included. It is never shown inside a datatype or a plain assoc, which are not occurrences, and never on a snapshot or timeslice portion, on a composite action, or on a self or happens link.

Formatter style options

Shift+Alt+F formats a file. Out of the box it does exactly what it always did: four-space indentation from editor.tabSize, one element per line, one blank line between top-level elements. Every option below is off or neutral by default, so adding the settings changes nothing until you turn one on.

Put them in .vscode/settings.json and commit the file. The language server, the editor and CI then all format the same way.

Setting Default What it does
sysml.format.indentStyle editor spaces or tabs overrides editor.insertSpaces.
sysml.format.indentSize 0 Characters per level. 0 follows editor.tabSize.
sysml.format.blankLines 1 Blank lines between top-level elements (0 to 2). The first element is never pushed down.
sysml.format.lineWidth 0 Wrap comma lists past this column (40 to 400). 0 never wraps.
sysml.format.emptyBody preserve semicolon writes part def P;, braces writes part def P { }.
sysml.format.quotedNames preserve unquoteSafe drops the quotes from 'Wheel' when the file declares it and the name is a plain identifier.
sysml.format.documentationIndent preserve align shifts a multi-line doc body to its owner's indentation.
sysml.format.keywords preserve symbolic writes :>, :>>, ::>, => and : for the keywords that mean the same.
// .vscode/settings.json
{
  "sysml.format.indentSize": 2,
  "sysml.format.lineWidth": 100,
  "sysml.format.emptyBody": "semicolon",
  "sysml.format.keywords": "symbolic"
}

Precedence. A caller that passes sysml.format.<option> with the format request wins (that is how the headless tools override one option). Then these settings. Then, for indentation only and only while indentStyle is editor or indentSize is 0, the editor's own editor.tabSize and editor.insertSpaces. A value the settings cannot use is refused with a warning and the previous value stays in force, so a typo never formats your repository differently in silence.

How the options interact.

All-view model tour

Download aliot-all-views.sysml from the public samples repository. One model supplies the SVG exports below, in Aliot Light and Aliot Dark. Grid View is shown in a VS Code screenshot and supports CSV export.

In VS Code, open the model, place the cursor inside the named anchor, then run SysML: Show Diagram. Choose the view from the diagram toolbar. Alternatively, find the element in Browser and choose its Diagram pill. Use Up to return to its parent's General View. Browser is available beside every view. Edit source or the supported Properties fields, then use Save All to save model and layout. Source Undo reverses model changes; geometry Undo reverses placement changes.

To reproduce the presentation, save project settings as .vscode/sysml/project.json and view settings as .vscode/sysml/diagrams/aliot-all-views.sysml.json beside the downloaded model. Port labels are enabled. Connections use orthogonal lines; GV tree uses curved lines.

Install the sysml-diagram npm package with npm install -g sysml-diagram. Run each command from the model's workspace. Add --theme dark for a dark export. To export the current VS Code arrangement, use SysML: Copy Headless CLI Command and omit --auto-layout.

General View: structure

Structure mode groups definitions, usages and features within their owning containers. Expand compartments to inspect members and follow relationships between elements.

Anchor: AliotShowcase::Architecture.

Open and edit in VS Code: Select General View and Compartments. Use + on a card to open its members. Right-click the canvas to add a definition or usage. Select a card and edit its Name, Type or attribute Value in Properties. Dragging cards changes the saved layout.

General View: structure exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view gv --anchor AliotShowcase::Architecture --gv-mode group --theme light --auto-layout --out gv-structure-light.svg

General View: tree

Tree mode lays out feature membership from parent to child in source order. Branches and links reveal ownership, typing and other relationships across the model.

Anchor: AliotShowcase::Architecture.

Open and edit in VS Code: Select General View and Tree. Open a package with + and follow the usage lines to their definitions. Select a usage line to edit each part's Name and Multiplicity in Properties. Use + on a grouped usage pill to expand its individual parts.

General View: tree exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view gv --anchor AliotShowcase::Architecture --gv-mode tree --theme light --auto-layout --out gv-tree-light.svg

Interconnection View

Shows how parts, ports, interfaces and connections form a system. Expand connection and interface blocks to inspect their ends, flows and nested ports.

Anchor: AliotShowcase::Architecture::drone.

Open and edit in VS Code: Select Interconnection View. Use + on powerFeed and commandBus to inspect their ends and flows. Open commands and drives to see nested ports. Drag between compatible port snap points to create a connection, or use the source port's context menu to choose an interface. Select a connection and drag an endpoint to reconnect it. Properties edits port names, types and conjugation. Auto-layout places ports toward their partners; manual port placements stay where you put them.

Interconnection View exported by sysml-diagram.

Light SVG · Dark SVG

Use + on a connection or interface pill to open its block. Use + on commands or drives to expose their nested ports. The saved view settings open these details and use a top-down layout. Geometry attribute lists are closed here to focus on connections; Geometry View still uses their complete solids.

sysml-diagram export --file aliot-all-views.sysml --view iv --anchor AliotShowcase::Architecture::drone --theme light --auto-layout --out iv-light.svg

Action Flow View

Shows how actions proceed through control and item flows. Forks, joins, loops and performer lanes make concurrency and responsibility visible.

Anchor: AliotShowcase::Mission.

Open and edit in VS Code: Select Action Flow View. Right-click inside Mission to add actions, fork/join nodes or a loop. Drag between action handles to create a succession, or between compatible pins to create an item flow. Select an action and choose Add performer to assign a part. Edit conditions in the control frame or Properties. Change the poll and until expressions in source to explore retryLink.

Action Flow View exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view afv --anchor AliotShowcase::Mission --theme light --auto-layout --out afv-light.svg

State Transition View

Shows the states and transitions of a state machine, including triggers, guards, effects and concurrent regions.

Anchor: AliotShowcase::FlightMode.

Open and edit in VS Code: Select State Transition View. Right-click inside the machine to add states. Drag between state handles to create a transition. Select a transition to edit its trigger, guard and effect in Properties. Select active and use the Parallel property for concurrent regions. Open entry, do or exit details with + when they have a body.

State Transition View exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view stv --anchor AliotShowcase::FlightMode --theme light --auto-layout --out stv-light.svg

Sequence View

Shows interactions over time as lifelines and ordered messages. Fragments express repetition or other control around message exchanges.

Anchor: AliotShowcase::DeliverySequence.

Open and edit in VS Code: Select Sequence View. Drag from a point on one lifeline to a point on another to create a message. Select a message to edit its name and payload in Properties. Drag it vertically to change its order. Edit the interaction's loop condition and participant references in source, then inspect the updated fragment. Participant header boxes do not start messages.

Sequence View exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view sv --anchor AliotShowcase::DeliverySequence --theme light --auto-layout --out sv-light.svg

Case View

Shows cases in relation to their subject and actors. Relationships between cases make shared or dependent behavior visible.

Anchor: AliotShowcase::Operations.

Open and edit in VS Code: Select Case View. Enable the subject boundary box in the view settings. Select deliver and inspect its Subject and Actors in Properties. Use its context menu to add an include relationship, then choose ready. Edit case names in Properties; edit subject and actor declarations in source when the desired field is read-only.

Case View exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view cv --anchor AliotShowcase::Operations --theme light --auto-layout --out cv-light.svg

Geometry View

Shows model geometry from shapes and coordinate frames, making spatial position, orientation and dimensions visible.

Anchor: AliotShowcase::Architecture::drone.

Open and edit in VS Code: Select Geometry View. Pan and zoom to inspect the assembly. The model's spatial data determines its plan or isometric presentation. Select a part to inspect its model properties. Edit its ShapeItems dimensions and coordinateFrame translation or rotation in source. Geometry follows those model values; moving a diagram label does not change a physical part's position.

Geometry View exported by sysml-diagram.

Light SVG · Dark SVG

sysml-diagram export --file aliot-all-views.sysml --view gev --anchor AliotShowcase::Architecture::drone --theme light --auto-layout --out gev-light.svg

Grid View: requirements

Lists requirements in a table for scanning, selection and editing supported fields. Adjust columns to focus on the data you need, or export the table as CSV.

Anchor: AliotShowcase.

Open and edit in VS Code: Select Grid View, then the Requirements preset. Edit a supported cell by double-clicking it. Use Properties for the selected requirement and the column controls to adjust the table. Choose Export CSV to share it. The screenshot below is the SDV sample; the downloaded CSV is the all-view model.

VS Code Grid View showing requirements for the software-defined vehicle sample.

Use Export CSV in the Grid View toolbar, or run the command below. Download the all-view model requirements CSV.

sysml-diagram export --file aliot-all-views.sysml --view grv --anchor AliotShowcase --theme light --auto-layout --out requirements.csv

SVG exports include visible labels. Long closed compartment rows can be shortened with an ellipsis, just as in the editor. Open the element or inspect Properties to read the full value.

Diagrams. all nine SysML v2 standard views

Run SysML: Show Diagram (editor title button, Command Palette, or the Show diagram CodeLens). The extension detects which views have content in the active file and offers only those:

View Abbrev. Shows
General View gv Definitions and usages, composition/specialization, packages and their contents, requirements with satisfy/verify/derive links, calcs/constraints/views with their compartments, annotations
Interconnection View iv Internal parts, directional ports, complete connection ends, interfaces vs = bindings, item flows
Action Flow View afv Actions (including actions owned by use-case usages), always-open structured action/inline-control frames with editable one-line clauses and pins, fork/join, decide/merge, succession flows, explicit send/accept endpoints, targeted terminate, parameter-pin flows, and resizable performer-set lanes
State Transition View stv States (composite + parallel), entry/do/exit, trigger [guard] / effect transitions, exhibitor boundaries, «causation»
Sequence View sv Lifelines, activation bars, messages (name of ItemType), dashed replies, event occurrences
Case View cv The familiar v1 look: case ovals stacked inside the subject (a part box linked by «subject» lines, or a v1-style boundary box via showSubjectAsBoundaryBox), stick-figure actors labelled name : Type standing left and right of the cases (above and below in Left→Right), includes, specialization
Geometry View gev Placed parts and shapes on an x/y plan or x/y/z isometric frame
Grid View grv Four toolbar presets: editable Requirements; Elements (Name, Type, Multiplicity, Doc; Kind read-only); Data (Name, Type, Value; Owner read-only); and Matrix. Matrix requires one toolbar-selected family: Allocation, Dependency, Satisfy, Flow, or Connection; Interface is not a Matrix family. Each preset and Matrix family remembers its own column order/widths. GRV is available when any preset has content. In Requirements, each per-attribute column title is the attribute's own name: double-click the title to rename that attribute on every requirement the table lists. The fixed titles (Id, Requirement, Doc, Subject, Constraint, Satisfy, Verify, Status) are read-only, and a rename that would give one requirement two attributes of one name is refused.
Browser View bv The hierarchical package/membership tree with expand/collapse

Browser rows on the current diagram keep their normal colors. Other rows are gray in light and dark themes. Hover a row to see its type (defined by). Types remain searchable. Thin curved guides show parent-child membership.

Geometry View uses model data. A placed part is the same usage shown in the structural views. Its SpatialItem shape defines the solid and its coordinateFrame chain defines placement and orientation. Resolved rotations turn the solid itself, including cylinders used as wheels. A separate layout instance is not required.

Properties opens with the element type icon, its name and kind, and its path as breadcrumbs. Reveal source, Reveal definition, Open definition, Open declaration and Open referenced element are icon buttons in that row; hover one for its name. Editable values sit on a light well, read-only values are plain text. Category headers show the member type icon and count. Properties tables fit the pane at every width. Drag a header divider to resize adjacent columns. Focus a divider and use Left or Right for keyboard resizing. Double-click it, or press Home, to reset equal widths. Widths survive member navigation and panel collapse. Only applicable columns appear. Definitions have no usage Type or Multiplicity cells. Use Reveal definition on a typed usage to open its definition in the source editor.

Ports show their calculated direction from directed contents when they have no explicit direction modifier. Directed member rows show their effective in, out or inout direction. The Conjugated checkbox edits the selected port usage's ~Type marker. It also works with inherited typing by creating a local override. A type can itself inherit reversed directions while the usage checkbox remains unchecked. Ports without a type and definitions have a disabled checkbox. A port with no directed contents shows None.

Change Direction in a member row or its details to edit a directed feature or action pin. Inherited choices show the effective direction, including port conjugation. Changes create or reuse a local override. Choose Inherited to restore the inherited direction, or None on a local member to clear its modifier. Eligible undirected port members and action parameters also offer a direction selector. Source validation still checks direction compatibility with redefined features. Direction edits support native Undo and Redo.

Click + in a supported editable category to open a blank name row. Attribute, part, port, item, action, state, constraint, parameter, directed feature and enum categories support creation. Press Enter or leave the field to apply the edit. Escape cancels. Inherited categories add to the selected concrete usage. Inspecting an inherited port also allows a local member to be added there.

Inherited Properties: SysML library and workspace members remain visible at every inheritance depth. Members inherited from KerML library files are omitted. Local overrides and directly inspected declarations remain visible, and semantic values still use the full hierarchy.

Properties uses one editor in every view. A slow selection request shows Loading properties. An unavailable selection shows an explanation.

Saving several Properties fields: changes save in order. You can continue editing while a field shows Saving or Queued. A queued field is checked against the current source before it is saved. A conflicting edit stays in its textbox with an explanation. The check icon applies your draft. The x icon discards it and restores the current source value. Tab reaches both icons without saving first. Leaving the whole cell still saves a single-line draft. Escape cancels unsent changes; a save already sent still completes.

You can queue a second note around a multiplicity edit. The other field does not cause a conflict after the first note is acknowledged. Rapid Conjugated toggles also continue when an inherited type becomes qualified in a local override. External changes to the edited field or its resolved port type still retain the draft for review.

Renaming shared members: use Open declaration to deliberately edit a shared member. It is also available on unnamed local overrides. Renaming there keeps inherited drafts attached to the renamed member, including nested usage paths and members declared in another file. Native Undo and Redo of that rename keep the drafts attached in both live and manual modes. Correcting a retained value draft still edits the selected usage.

Browser rows that support Show diagrams carry a small Diagram pill. Click it to open the element's diagrams. The up arrow beside the filter opens the current root's parent in General View and clears both Browser filters. It is disabled at the file root.

Selecting a named package root in Browser opens its editable Properties and member compartments. Renaming that root keeps the diagram on the same package through Undo and Redo.

Members inside local redefinitions keep their owning part's identity. Same-named members under different parts keep separate drafts, even after source text moves or one member is renamed.

Unrelated base definitions can contribute members with the same name. Properties shows separate rows with From labels naming their declarations. Edit either value to create a qualified override inside the selected usage. The other member and both base definitions stay unchanged. Clearing restores that member's inherited value. Shared renames keep drafts attached even when the names become unique and the From labels disappear. Properties also follows a known declaration name changed by typing in the source editor or by F2. Drafts follow its native Undo and Redo in live and manual update modes. This also applies when a dependency is first opened, before its Properties refresh finishes. Nested overrides preserve sibling drafts when a member name stops needing qualification. Replacing the whole declaration does not transfer its draft to a differently named replacement.

If a member redefines several declarations, its Value cell lists the contributing inherited expressions and their sources. Properties does not evaluate them or choose one by order. Enter a local value in the editor. Clear it to show the inherited expressions again. A more specific value replaces its redefined ancestor in that list. An unresolved or ambiguous redefinition does not borrow a value from a namesake. Correct its source reference to restore inheritance. An exact local declaration can still hold its own value.

The Interconnection View keeps constraints as text rows until its constraints filter is on; then it draws every constraint with its bindings and shows each claim with the actual owner context. Properties and General View also expose claims. In nested views, the child boundary replaces duplicate ownership and metadata attachment lines. Independent references and links to other owners remain visible.

Large Interconnection Views keep the current drawing visible while preparing a toolbar change. You can change the options again during preparation. The latest choice wins, and the completed drawing retains all selected content.

Reference rows: a ref part bound to another element (ref part spare = wheels;), or a usage that subsets another, stands for that element. Its table row shows its name and the type it reads through the referenced element; the bound value is not a table cell. Inspect the row to see the value and use Open referenced element to open the element it names, in the usage context the path walks (demo.frontLeft opens frontLeft inside demo).

Relationship Properties: flows, successions, transitions and unnamed connections or interfaces are lines. They are not rows of their owner in Properties: select the line on the canvas to open them. A named connection or interface usage keeps its row. Select a binary connection, flow, binding, succession or transition to edit its From and To paths. Enter a SysML path such as pump.output. Guarded successions and transitions also expose their complete Guard expression. These edits preserve the surrounding notation. Inherited connection endpoints stay read-only, even with definition synchronization enabled. Choose Open declaration to edit the shared relationship deliberately.

Connections with several ends, and typed connections with body-declared ends, show a Connection ends compartment. Each row shows its role and an editable endpoint path. Unbound typed roles appear as empty fields. Binding a role adds its local end declaration while preserving the other roles. Clear a body binding to restore its inherited endpoint or leave it unbound. Inline end lists require a path in each position. The table stays aligned in a narrow pane. Drag its column dividers to adjust the widths. These edits use the same saved drafts, validation and native Undo as other Properties fields.

For an inherited named connection or interface with named ends, editing an endpoint creates a local redefinition inside the selected part usage. This also works for nested usages and definitions in another file. Other usages and the shared definition stay unchanged, regardless of definition synchronization. Clearing the local binding reveals its inherited endpoint. Anonymous inherited connection statements require Open declaration to edit their shared endpoints.

Structured actions expose Condition, Iteration and Until where authored. Iteration includes the variable, optional type and sequence. These fields preserve the action name and body and reject extra statements. Cases, concerns and requirements expose Subject type. Changing it preserves the subject's name, value and body. Inherited structured controls remain read-only until you open their declaration.

Tree usage bundles: selecting a derived usage line lists its owner's immediate part usages of the target definition. Each usage has its own Name, Type and Multiplicity fields, even when its card is closed. Inspect a row to edit that usage's contents, then use Back to return. The list refreshes from source after a type change. Open definition explicitly opens the shared definition. Definition renames retain the selected bundle, navigation and drafts. Bundle fields use the same queued saves and native Undo as ordinary selections.

Metadata Properties: the metadata compartment keeps entries in source order. Named applications have Name and Type editors. Unnamed @Type applications have a Type editor and their own Inspect action. Inspect an application to edit its attribute values, including inherited values. Changes create local bindings and preserve the shared metadata definition and about targets. Separate unnamed applications retain separate drafts. Values and application names support native Undo and Redo.

When using an input method, finish composing before pressing Enter to save a field. Confirmation keys do not save unfinished text. If you leave a field during composition, it waits for the completed value before saving. Documentation and multiline expressions stay as drafts until the check icon or Ctrl+Enter is used. The x icon or Escape restores the source value.

Interconnection View layers

The Interconnection View has one presentation: the parts, ports and wiring at every depth, the members listed on each part, and the actions a part performs mapped onto it. The toolbar icons filter the optional layers:

Auto-layout keeps the connected ranks in TB and LR at every nesting level and turns each wired port toward its partner afterwards; a port you placed keeps its side. Smart lays the view out both ways and keeps the one that fits your screen better. A part wired to its own internal part ranks nothing. These controls change the diagram only; they do not edit the model.

State action detail: an entry, do or exit row whose action has a body carries a + on its heading. Press it to draw the body inside the state; the heading keeps a − that closes it, and the states below make room. A transition whose effect has a body carries a + on its pill. Press it to stand the effect between the two states, like another state: the pill becomes a «transition» box with the trigger and guard in its heading. The minus in its corner restores the pill. The incoming line has no arrowhead; only the outgoing line toward the target has one. A self-transition's effect stands beside its state. An effect without a body opens as a card with its declaration. Each choice is saved with the view. Substate controls do not close these action bodies. Shared typed or referenced actions keep their source context; choose Open declaration in Properties to edit the shared declaration. A self-transition is drawn as a loop in every connector style.

Action Flow has one presentation: action bodies are open and the control flow ranks the layout. Close a body with its own control or the toolbar's internals icon. Hover a card for body status and provenance. Open its declaration to inspect full source. Inferred communication candidates explain their provenance in Properties and are read-only.

Right-click a blank canvas area and choose Export layout diagnostics… to save the visible scene and final geometry as JSON. It includes conflict counts and fallback reasons. This helps reproduce a drawing problem. The CLI equivalent is sysml-diagram export --file model.sysml --view stv --debug-layout, which writes a report beside the SVG. Enabling diagnostics leaves the SVG unchanged. Manual routes and explicit General View routes remain fixed even when the report identifies an obstacle. Use Reroute or Auto-layout to change them.

Port labels and shared connection lines

Port name pills match the port outline and selection. A port keeps its name when open. Its plus and minus controls stay on the pill. Drag a pill to move it, or double-click to reset its placement.

A port attached to a part expands only when it contains another port. Items and attributes stay in Properties. Inside an interface or connection block, port expansion retains the detailed items. Item pins have smaller permanent labels. A label uses the name, otherwise the type, and stays absent when both are missing.

Connections and interfaces between the same port pair share one line. Each has its own selectable pill and plus control. Drag a pill to place it. A dashed guide shows its attachment to the line during the drag. Flow, interface and connection pills show only their name. Without a name, they show the type (the transported type is also available for flows). Without either, no pill appears; a flow keeps its arrow. Select that line to see its Flows, Connections and Interfaces in the standard Properties tables. Use the trailing > on a row to open its details. Back returns to the line contents. The details offer Delete and, for relationships, Open block. The line context menu also deletes individual members. Existing definition editing settings apply to inherited flows. Editing a shared declaration affects every usage.

Flows defined inside a connection or interface stay hidden until its block opens. The block title replaces its line pill. Lines entering and leaving the block do not repeat its name or type. Closing the block restores its pill and hides its carried flows.

For flows declared outside those relationships, hidden item pins use direction arrows on the line. Each flow keeps its name pill above the arrow, or beside a vertical segment. Click the pill to inspect the flow, or drag it along the line with its arrow. When either end exposes items, each flow gets its own line to its item pin or the nearest visible endpoint. Flow Properties show the declared flow type and resolved payload type separately. Explicit relationship pills can open to inspect their labelled ends even without internal flows.

Try the connected drone in the all-view model.

Enumeration Properties

Enum definitions stay flat in General View and Browser View. Select one to edit its Literals list. Edit a name or its optional Value expression, then press Enter. Click + beside the Literals title to open a blank row. Enter its name, then press Enter or leave the row to add it. Opening the row does not change source. Escape or the row cancel button discards it. This also works on an empty definition. Duplicate names are rejected and the draft stays available for correction. Each editable literal has an × to remove its declaration, including any bindings in its body. Undo restores it.

Quantity choices keep their units in the Value expression, for example 60 [SI::mm] in an enum that specializes ISQ::LengthValue. An unnamed literal has only a value editor. Its expression cannot be cleared. A literal with structured bindings offers a details button to inspect its attributes.

An enum usage is a separate feature. Its Properties retain Type, Multiplicity and Value, such as RiskLevel::low. It can expand when it has actual nested content, including another enum usage. For example, enum assessedRisk : RiskLevel { enum indicator : SignalColor = SignalColor::green; } shows indicator as a child in GV and BV. An enum definition cannot directly contain another enum definition. Its enum members are literals. The definition's literals do not appear as inherited child features.

Calculations and constraint claims

Open Action Flow on a calculation or its containing package or action. Calculation usages show inherited input pins and the effective result pin. Select an input to inspect its bound value, or the calculation to inspect its result expression. Successions attach to calculation bodies; flows attach to pins.

General View shows asserted, assumed and required constraints with source-linked claim arrows. An inline claim keeps its own name, type and bindings. A reference claim points to the existing constraint. In Interconnection View, turn on the constraints filter to show the constraints with their parameters, bindings and claims. External targets retain their actual owners.

Standard library

The complete OMG SysML v2 standard library ships with the extension, pre-indexed, so Real, MassValue, ISQ, and friends resolve instantly with zero startup parsing. SysML: Open Standard Library Folder opens the sources; hover any library symbol for a direct link.

Verification

The CodeLens above a verification def runs it: the server evaluates the case's verify requirements against the model (constraint evaluation included) and reports pass/fail/inconclusive in the SysML Verification output channel. The Grid View shows requirement status at a glance.

.kpar archives and abstract-syntax JSON

Open or extract OMG .kpar package archives (Explorer context menu or Command Palette); JSON-only abstract-syntax archives are projected into generated .sysml so the whole toolchain works on them. SysML: Export Abstract Syntax JSON writes the active model in the interchange format.

AI agent tools

If you use a VS Code AI agent (Copilot Chat or similar), the extension contributes eight language-model tools. SysML modeling guidance, model context, draft validation, library/unit search, symbol/import resolution, requirement tracing, and diagnostic explanation. all answered deterministically by the language server, never guessed.

Commands

Open the Command Palette (Ctrl+Shift+P) and type SysML:

Command Purpose
SysML: Show Diagram Open the diagram preview for the active model
SysML: Which Diagram? (view guidance) Pick the question to answer → opens the recommended view
SysML: Show Diagnostic Reference Catalogue of every diagnostic code with examples
SysML: Report Parse Coverage Parse health of every model file in the workspace
SysML: Open / Reload Standard Library Browse or re-index the bundled OMG library
SysML: Open / Extract .kpar Archive Work with OMG package archives
SysML: Open / Export Abstract Syntax JSON Interchange-format import/export
SysML: Show Syntax Tree Parser debug view for the active file
SysML: Restart Language Server If the server stops responding

8. Configuration

Open Settings (Ctrl+,) and search for sysml. All 17 settings are wired and honored:

Setting Default Purpose
sysml.standardLibraryPath bundled Point at an external sysml.library source tree or .kpar archive instead of the bundled library
sysml.validation.severities {} Per-code severity overrides, e.g. { "STYL001": "off", "RES009": "error" }
sysml.diagnostics.unusedImports off Report unused imports (off/warning/error)
sysml.diagnostics.units true UNIT001–005 dimensional-analysis checks
sysml.editor.autoImportOnSave false Opt in to adding missing workspace imports when saving
sysml.inlineCompletion.enabled / .categories true Ghost-text suggestions and per-trigger opt-outs
sysml.inlayHints.dimension true Physical-dimension hints after quantity expressions
sysml.outline.hiddenCategories [] Hide documentation/representation outline groups
sysml.workspace.backgroundIndexing imports Background indexing: imports (follow open files´ imports) / all / off
sysml.preview.diagrams.update live When diagrams re-render (live/on-save/manual)
sysml.preview.diagrams.defaultKind iv Preferred view among the nine (gv…bv)
sysml.preview.diagrams.showPortLabels true Port names next to stubs
sysml.preview.diagrams.showMultiplicities false [1], [0..*] next to usage labels
sysml.preview.diagrams.showSubjectAsBoundaryBox false Case View: v1-style system boundary box containing the subject´s cases
sysml.trace.server off LSP trace logging (off/messages/verbose)

Diagram settings can also be set per project in <workspaceFolder>/.vscode/sysml/project.json (overrides VS Code settings; useful for team conventions checked into the repo).


9. Troubleshooting

The language identifier doesn't show "SysML"

Syntax highlighting isn't working

The language server crashes on startup

  1. Open Output → SysML Language Server to see error messages.
  2. Update Aliot from the Extensions view, then run Developer: Reload Window.
  3. Run SysML: Restart Language Server from the Command Palette.
  4. Enable sysml.trace.server: verbose and check the log for the last successful message before the crash.

Unexpected parse errors in a valid model

A diagram view is missing from the selector

The selector only offers views that have content in the active file. a file without states offers no State Transition View, one without requirement definitions no Grid View. Add the corresponding elements, or run SysML: Which Diagram? to see what each view needs.


10. Further Reading

Resource Location
OMG SysML v2.0, Part 1. the normative specification. Keyword hovers cite its §8.2.2 (Textual Notation). omg.org/spec/SysML/2.0
OMG KerML v1.0. the kernel SysML v2 builds on. Operator hovers cite its §8.2.5.8 (Expressions). omg.org/spec/KerML/1.0
Public example models SysML v2 samples
Flashlight model flashlight.sysml
Properties and hierarchy walkthrough Try Properties editing
Report a problem Public issue tracker