A Visual Studio Code extension providing INTERLIS 2.4 language support. The colors of the syntax highlighting are customizable using the colors of the current color theme by default. In addition, this extension provides snippets for commonly used blocks in INTERLIS 2 and a markdown documentation generator.
The extension associates with .ILI
files and applies coloring to the different elements in the file, for example:
- Object names like
TOPIC
MODEL
CLASS
- Data types like
BOOLEAN
TEXT
- Keywords like
ASSOCIATION
ABSTRACT
EXTENDS
- String patterns like
{...}
The extension provides interactive snippets for commonly used INTERLIS 2 blocks. To use the snippets start by typing the name of the block until VSC provides the correct option as suggestion. Select the snippet with the arrow keys and hit ENTER
to insert. Navigate through the snippet and its options with TAB
.
Supported snippets include: MODEL
, TOPIC
, CLASS
, STRUCTURE
, ASSOCIATION
and Role
The extension provides code navigation to referenced symbols such as classes, structures and imported models using the Go To Definition functionality (default hotkey F12
or Ctrl + left mouse click
).
Imported models from the model repositories are downloaded automatically to enable navigation to external models.
To make VS Code treat other file extensions than the default .ili
as INTERLIS2 files, add the following to the user settings:
"files.associations": {
"*.ili*": "INTERLIS2"
},
The example above associates extensions such as .ili
with this extension.
The extension provides the command "Generate markdown documentation" to create markdown code from an INTERLIS 2 file describing the classes and their attributes. This command can be executed from the Command Palette (Default hotkey Ctrl+Shift+P
) or the context menu of an open INTERLIS 2 file.
Watch your ILI models come to life in real time. As you type, the diagram automatically updates so you can instantly see your model’s structure, spot inconsistencies, and keep everything aligned—no extra clicks required. Export the diagram as .SVG to embed in your webpages, or copy the mermaid code directly to your clipboard.
The Format Document command automatically formats your entire INTERLIS file. It adjusts indentation and spacing to make the code more readable and consistent, while carefully preserving all existing comments. You can invoke this command by right-clicking in an INTERLIS editor and selecting "Format Document" from the context menu.