Essentials
Syside Editor activates when .sysml or .kerml file is open, providing features
that help you write, edit and validate SysML v2 models. All examples in this section are
showcased in the Visual Studio Code editor.
Learn about:
Example Model: copy this model into your .sysml file to test out the features of
Syside, or use your own model.
package 'Part Tree Example' {
part def Electrical {
doc /*
* Electrical parts have this documentation
*/
}
part def Mechanical;
part Automobile {
part 'Drive Train' {
part Battery : Electrical;
part Motor : Electrical;
}
part Chassis {
part Suspension : Mechanical;
part Body : Mechanical;
}
}
}
Semantic Highlighting
Whenever a .sysml or .kerml file is open, Syside language server is active. In
light-theme, highlighted textual notation may look similar to this:
SysML v2 keywords – such as package, part or def – are highlighted in
pink. If a part is given a name that is also a reserved keyword in SysML v2, such as
frame, two things will happen:
The word
framewill be highlighted.The editor will show a red underline and highlight, indicating an error, together with an error message.
Additionally, Syside language server highlights Definitions and Usages in
distinct colors, enhancing the ability to quickly identify various semantic elements.
Warning
Dark (Visual Studio) and Light (Visual Studio) themes do not support semantic
highlighting. To ensure proper highlighting, use a modern theme such as Dark+ or
Light+. You can change the theme using the Preferences: Color Theme command.
More information about themes can be found on VS Code documentation.
Documentation on Hover
Syside language server understands links between SysML v2 elements and uses this to
provide documentation on cursor hover. This is useful for quickly accessing information
about a certain model element without having to necessarily navigate to it. Try it out
by hovering over the word Battery in the example model – a tooltip like this
appears:
Syside language server takes the documentation (the doc keyword) from either:
The focused element, if it has any documentation defined;
The first (most specific) explicitly or implicitly specializing type that has documentation.
If the element or specializing type has multiple documentations, they will be grouped together.
Hover functionality is useful for quickly inspecting how a certain element is defined without needing to navigate to the location of the definition, which could be in an another file entirely! Syside language server takes the whole model into account.
Tip
You can use Markdown formatting in your documentation text and the applied formatting will show up during Hover!
Document Outline
The Outline view provides a quick overview of all elements in your currently opened file. To open it:
Press Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS to open the Command Palette
Type
outlineand select “User View Container: Focus on Outline View”
Click any element in the outline to jump directly to its location in the editor. You can collapse the Folder section to give the Outline more space.
Folding
Use folding to hide nested elements and make large models more manageable. Hover next to any element to reveal the fold arrow:
Click the arrow to fold/unfold the element. You can also use the Command Palette Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS to find the ‘Toggle Fold’ command and its keyboard shortcut.
Auto Completion
Syside language server provides intelligent code completion for both SysML v2 keywords and your model elements. To try it out:
Start typing “pack” to see keyword suggestions
Press Tab to accept a suggestion
When importing elements, the editor suggests existing package names and automatically adds the required quotes:
Validation
Syside language server continuously validates your model as you type. Try copy-pasting this example after your model into the same file:
package Test {
import 'Part Tree Example';
}
The editor will show an error because import does not have an explicit visibility as
mandated by SysML v2 2024-09 and newer. Hover over the red underlined text to see the
error message as shown above. To comply with specification, add private before
import. Syside language server once again checks the model for errors automatically
but does not find any this time.
Auto Formatting
Syside language server can automatically format your model to maintain consistent style. To enable automatic formatting:
Open settings with Ctrl/Cmd+Comma
Search for “Editor: Format On Save” and enable it. Alternatively, use the
"editor.formatOnSave": trueconfiguration option.
You can also format selected code by right-clicking and choosing “Format Selection”. The formatter preserves your custom formatting conventions while ensuring consistent style across the model.
The formatter supports ignore directives to let you preserve specific formatting for
sections of your models.
An example of such an directive is shown below:
package P {
part def PartDef;
// syside-format ignore
part 'my unformatted AST' : PartDef {
}
}
The directive preserves the formatting of the abstract syntax it is attached to, while maintaining consistent indentation for the rest of the file.
What’s Next?
You’ve now learned the essential features of Syside Editor for SysML v2 textual modeling. To continue:
Check out the Tips and Tricks section for improving your workflows and working environment
Check out the Configure Editor section and configure Editor for your use case
Join our Community Forum and discuss SysML v2 or Syside with other Syside users
Explore Modeler for learning about a professional edition of Syside Editor with visualisation capabilities
Visit Automator to learn about automation and scripting features