lspd2 - D2 Language Server
Intelligent autocomplete, validation, and documentation for D2 diagram files.
Features
✅ Smart Autocomplete
- Shape suggestions (rectangle, hexagon, cylinder, etc.)
- Style property completion
- Direction keywords
✅ Real-Time Validation
- Invalid shape detection
- Unknown style properties
- Undefined connection targets
✅ Hover Documentation
- Shape descriptions
- Style property details
Installation
Search "lspd2" in VS Code Extensions or:
ext install lspd2
Usage
Open any .d2 file and start typing:
myapp: My App {
shape: rec # Autocompletes to "rectangle"
style.fill: "#e3f2fd"
}
Roadmap
- [ ] Go-to-definition
- [ ] Rename symbol
- [ ] Code actions (quick fixes)
- [ ] Workspace symbols
| |