A VS Code extension for C4 DSL Models
This is a VS Code extension for specifying software architecture models with the Structurizr DSL.
A generator creates PlantUML diagrams on-the-fly, while editing. The diagrams are located in a sub-folder named plantuml-gen.
Every C4 view in the editor will be enriched with a code lense (Show as Plant UML). When clicking, the corresponding plantuml file will be converted into a svg file, utilizing the free service from kroki.io. The graph is then displayed in a separate window.
Beside that it provides all typical language editor features like:
When describing C4 models textually, there are plenty of raw strings describing different aspects and meta data of a model element. They are visually difficult to be distinguished from each other.
Therefore a semantic highlighting options is provided, in order to highlight the different aspects in different colors (see screenshot below).
You can switch it off (configuration property 'c4.language.SemanticHighlighting') in case it is too dazzling... It falls back to raw syntax coloring then.
PlantUML Render Options
Supports the different Plant UML render options provided by the origin structurizr-plantuml project. You can change the renderer by setting the corresponding configuration: c4.plantuml.generator
Explanation is taken from the origin README:
Xtext requires a Java VM for running the language server.
You must open a workspace, that contains you models, which need to have the file extension .dsl
Multiple workspaces are supported.
The architecture (i.e. its diagrams) of this extension is modeled with - guess what - the c4 dsl itself. Just open "../workspace/c4-dsl-extension.dsl" in your VS Code.
The workspace folder does also contain some basic examples from the structurizr dsl website.
The goal is, that the Xtext grammar (used in this extension) is compliant to the origin language reference.
However the Xtext grammar is a bit more strict in some points:
Unsupported DSL Elements
As of now following DSL elements from the language reference are not yet supported:
Those elements will be provided in subsequent releases.