Warning
This is an unreleased Zed extension under active development. Currently it needs to be manually installed.
Zed exention for the Structurizr DSL, a text-based DSL commonly used to describe C4 architecture models.
- syntax highlighting for the currently supported Structurizr DSL surface
- block-aware indentation for core workspace, model, deployment, view, and style constructs
- bracket matching for Structurizr block delimiters
- outline support for workspaces, model elements, views, styles, and configuration blocks
- folding queries for the major block forms supported by the grammar
- text objects for block and comment navigation in Zed's Vim mode
- local language-server launching for
strz-lspvia Zedlsp.strz-lsp.binary.path,STRZ_LSP_BIN, orPATH.
The extension is published as Structurizr DSL and is intended for users working with Structurizr and C4-style architecture modelling in .dsl files.
If Zed does not automatically detect a file, select Structurizr DSL from the language picker.
extension.tomlcontains the extension manifest and the pinned upstream grammar reference.languages/structurizr/contains the Zed-specific language config and Tree-sitter query files that shape the editor experience.src/lib.rscontains the extension code for registering thestrzLSP with Zed.
To install the extension locally in Zed:
- Clone this repo
git clone [email protected]:sinon/zed-structurizr.git - Open the command palette in Zed and run
zed: install dev extension. - Select the directory where project was cloned to e.g
~/dev/zed-structurizr. - Open a
.dslfile in your editor once extension has finished installing.
To test the local LSP integration:
- Build
strzfrom https://github.com/sinon/tree-sitter-structurizr - In Zed user settings or the target worktree's
.zed/settings.json, configure:
{
"lsp": {
"strz-lsp": {
"binary": {
"path": "~/path-to/strz",
"args": ["server"]
}
}
}
}- Launch Zed, optionally
--foregroundcan be set when launching from CLI to help with debugging.
For one-shot terminal launches, the extension also honors
STRZ_LSP_BIN from Zed's shell environment when you start a fresh Zed
instance:
STRZ_LSP_BIN=~/path-to/strz zed --foregroundIf no explicit override is configured, the extension will look for
strz on PATH.
If Zed is already running, prefer lsp.strz-lsp.binary.path; launching
zed again from a shell does not reliably replace the environment of the
already-running app.
Also useful for debugging is zed: open log from the Command Palette.
When updating editor support, keep the extension-side query files in languages/structurizr/ aligned with the grammar's supported syntax and bump the pinned grammar revision in extension.toml when the extension should consume newer grammar behavior.