Getting Started
Installation
Install the Spec42 extension from the VS Code Marketplace.
Once installed, open a folder containing .sysml or .kerml files and the language server starts automatically.
Your first model
The fastest way to get started is to open one of the built-in examples:
- Open the Spec42 tab in the left sidebar.
- Under Examples, click timer (marked with a star — this is the recommended starting point).
- The workspace opens with a complete SysML v2 model.
You can also create a new file with a .sysml extension and start writing:
package MyFirstModel {
part def Sensor {
attribute name : String;
port dataOut;
}
part def Controller {
port dataIn;
}
part def System {
part sensor : Sensor;
part controller : Controller;
connect sensor.dataOut to controller.dataIn;
}
}Exploring your model
After opening a SysML workspace, the Spec42 sidebar gives you four main tools:
- Model Explorer for browsing packages and elements.
- Examples for opening bundled sample workspaces.
- Help for quick reference links and the quick-reference panel.
- Library for searching the bundled standard/domain libraries and any custom libraries you add.
The Model Explorer can switch between a semantic model view and a by-file view. Use it to reveal source locations, copy qualified names, and open package-level visualizations.
Opening the visualizer
The diagram visualizer lives in the secondary sidebar (right side of VS Code).
- Open it via View → Secondary Side Bar, or
- Use the Help section in the Spec42 sidebar and click Open diagram visualizer.
Once open, select a view from the dropdown in the toolbar to render your model as a diagram.
Inspecting elements
The Feature Inspector also lives in the secondary sidebar alongside the visualizer.
- Place the cursor on a SysML/KerML keyword, element, reference, value, or unit.
- The inspector follows the current selection and shows resolved semantics, relationships, source location, and language help.
- Clicking a node in the visualizer pins the inspector to that element until you resume following the cursor.
Next steps
- Browse the examples to see what Spec42 can do.
- Learn the Model Explorer for navigating larger workspaces.
- Learn the visualizer to get the most out of the diagrams.
- Learn the Feature Inspector for resolved semantic details.
- Manage libraries and dependencies for standard, domain, custom, and Sysand-backed content.
- What's included for Spec42 and bundled library versions.
- SysML v2 Quick Reference for language syntax.