A VS Code extension for C4 DSL Models
With version > v3.0.0 this extension is under heavy re-construction. Use on your own risk.
The Xtext Grammar has been removed and thus the language server needs to be reimplemented from scratch. Be aware that many features are not yet (fully) available.
The !include is not yet fully supported, i.e. it might not work correctly, in case the entire model is not self-contained in one file.
This is a VS Code extension for specifying software architecture models with the Structurizr DSL.
Technically there is language server built on top of the origin Structurizr DSL parser.
Every C4 view in the editor will be enriched with a code lense in order to render the corresponding view, either with a kroki.io server (if rendering type is 'plantuml' or with the structurizr.com server (if rendering type is 'structurizr'). In either way your c4 model will be sent as a Base64-encoded string to any of the public webservices for rendering purposes. This feature is deactivated by default, in case of you have concerns making your diagrams public. You can activate the feature by setting the corresponding configuration property c4.diagram.structurizr.enabled or c4.diagram.plantuml.enabled to true.
You can trigger the export of all views from one dsl file into plantuml code, either in the context view of the explorer or the editor. Output folder and Plant UML Renderer are configurable.
Language Server feaature
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 distinguish from each other.
Therefore a semantic highlighting option is provided, in order to highlight the different aspects in different colors (see screenshot below).
A Java VM is required for running the language server. Java 8 or higher is required.
You must open a workspace that contains your models, which need to have the file extension
Multiple workspaces are supported.
The architecture (i.e. its diagrams) of this extension is modeled with - guess what - the C4 DSL itself.
The workspace folder also contains some basic examples from the structurizr dsl website.
Feel free to submit an issue in case you recognize a shortcoming or if you want to request a feature. Please attach the corresponding dsl file or its content to the issue, so that the problem can be reproduced.