Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>D2Lang LSPNew to Visual Studio Code? Get it now.
D2Lang LSP

D2Lang LSP

Rohan Shetty

| (0) | Free
LSP for D2 diagram language
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft