LikeC4 for Zed
LikeC4 language support for the Zed editor.
LikeC4 is an architecture-as-code DSL that lets you describe your software architecture with a simple, human-readable language and visualize it as interactive diagrams.
This extension brings first-class LikeC4 editing experience to Zed with a custom tree-sitter grammar and the official LikeC4 Language Server.
Features
- Syntax highlighting — rich, tree-sitter-based highlighting for all LikeC4 constructs
- Code completion — context-aware suggestions for elements, relationships, views, and keywords
- Diagnostics — real-time validation errors and warnings as you type
- Hover information — documentation and details on hover
- Go to Definition — jump to element and relationship definitions
- Find References — locate all usages of an element across your workspace
- Rename — safely rename elements with all references updated
- Code outline — navigate your architecture models with the Outline panel
- Auto-indentation — smart indentation for all block types
- Bracket matching — automatic matching of braces
Installation
- Open Zed
- Open the Extensions panel (
Cmd+Shift+Xon macOS) - Search for "LikeC4"
- Click Install
The extension will automatically download and manage the LikeC4 language server.
Configuration
Language Server Settings
You can pass custom settings to the LikeC4 language server through your Zed settings (Cmd+,):
{
"lsp": {
"likec4-language-server": {
"settings": {},
"initialization_options": {}
}
}
}Limitations
- No diagram preview — Zed does not currently support webview panels in extensions, so live diagram visualization is not available. Use the LikeC4 CLI or the VSCode extension for diagram previews.
Development
Prerequisites
- Rust (installed via rustup)
- The
wasm32-wasip1target:rustup target add wasm32-wasip1
Building
# Lint (mirrors CI)
cargo clippy --target wasm32-wasip1 -- -D warnings
# Build release WASM
cargo build --release --target wasm32-wasip1Testing locally
- Open Zed
- Open the Extensions panel
- Click Install Dev Extension
- Select the root directory of this repository
- Open a
.likec4file to verify syntax highlighting and the language server
Resources
Links
- LikeC4 Website
- LikeC4 DSL Specification
- LikeC4 Language Server (npm)
- LikeC4 GitHub Repository
- Tree-sitter Grammar
License
MIT — see LICENSE for details.