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

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, 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)
- Model Explorer — Tree view showing packages and elements across your workspace
- Interactive Diagrams — General View, Interconnection View, Action Flow View, State Transition View, Sequence View, Case View and others with search/pan/zoom/export
Demo

Screenshots
General View

Interconnection View

Action Flow View

State Transition View

Hierarchy View

Graph View

Tree View

Installation
- Open VS Code Extensions (Ctrl+Shift+X)
- Search for "SysML v2"
- Click Install
Or install manually from .vsix: Extensions → ⋯ → Install from VSIX
Usage
Create .sysml or .kerml files:
package MySystem {
part def Vehicle {
attribute mass : Real;
}
part car : Vehicle;
}
Commands (Ctrl+Shift+P)
| Command |
Description |
SysML: Show Model Visualizer |
Open interactive diagram for the current file |
SysML: Show Model Explorer |
Open the tree view showing packages and elements |
SysML: Validate SysML Model |
Run validation on the current file |
SysML: Format SysML Document |
Format the current SysML file |
SysML: Export Visualization (PNG/SVG) |
Export the current diagram as PNG or SVG |
SysML: Change Visualizer View |
Switch between diagram views (General, IBD, Activity, etc.) |
SysML: Refresh Visualization |
Re-render the current diagram |
SysML: Jump to Definition |
Navigate to the definition of the symbol under cursor |
SysML: Clear Parse Cache |
Clear the cached parse results |
SysML: Refresh Model Tree |
Refresh the Model Explorer tree view |
SysML: Restart Language Server |
Restart the SysML LSP server |
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.
Settings
| Setting |
Default |
Description |
sysml.validation.enabled |
true |
Enable SysML model validation |
sysml.format.indentSize |
4 |
Number 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.defaultScale |
2 |
Default scale factor for PNG exports (1x–4x) |
sysml.library.path |
"" |
Path to SysML v2 standard library directory |
sysml.maxNumberOfProblems |
100 |
Maximum number of problems reported per file |
sysml.inlayHints.enabled |
false |
Enable inlay hints (inline type annotations). May interfere with renaming — disable if you experience editing issues |
sysmlLanguageServer.trace.server |
"off" |
Traces communication between VS Code and the language server (off, messages, verbose) |
Development
npm install && npm run compile && npm test
License
MIT
| |