Skip to content

Editor Setup (VS Code)

The Shape Language extension for VS Code provides syntax highlighting and full LSP integration.

Open VS Code and either:

  • Search “Shape Language” in the Extensions panel (Ctrl+Shift+X)
  • Or run from the command line:
Terminal window
code --install-extension shape-lang.shape-lang

The extension needs shape-lsp on your PATH for full language support (completions, diagnostics, hover, go-to-definition, semantic tokens).

If shape-lsp is not installed, the extension will detect this on first activation and offer to install it automatically via cargo install shape-lsp. Click “Install via cargo” in the notification.

To install manually:

Terminal window
cargo install shape-lsp

Without the LSP (extension only):

  • Syntax highlighting (TextMate grammar)
  • Bracket matching and auto-closing
  • Code folding
  • Comment toggling (Ctrl+/)
  • .shape file association

With the LSP (extension + shape-lsp):

  • Real-time diagnostics (errors and warnings) — both push (publishDiagnostics) and pull (textDocument/diagnostic)
  • Completions with type information, including method-chain completions after .
  • Hover documentation on identifiers, types, and methods
  • Signature help on call sites ((, , triggers)
  • Go-to-definition (F12), declaration, type-definition, implementation
  • Find references (cross-file) + document highlights
  • Rename symbol (cross-file) with prepare-rename
  • Document symbols (outline view) + workspace symbols
  • Call hierarchy (incoming/outgoing calls)
  • Code actions (quickfixes; extract-fn; extract-var)
  • Code lens (test runners + trait implementation counts)
  • Semantic token highlighting (range + delta)
  • Inlay hints (types, parameter names, chain types — see settings below)
  • Folding ranges + document links

All settings live under the shape.* namespace. Add them to settings.json (workspace or user). The inlay-hint master is ON by default; Shape-unique opt-in categories are OFF by default so the editor stays uncluttered:

SettingDefaultDescription
shape.inlayHints.enabletrueMaster toggle. False suppresses every category.
shape.inlayHints.typeHintstrueInferred type hints on let bindings.
shape.inlayHints.parameterHintstrueParameter-name hints at call sites.
shape.inlayHints.variableTypeHintstrueInferred variable types where elided.
shape.inlayHints.returnTypeHintstrueInferred return-type hints on fn declarations.
shape.inlayHints.chainHintstrueIntermediate-type hints on method-chain expressions.
shape.inlayHints.bindingStorageClass.enablefalse (opt-in)Shape-unique: surfaces the compiler’s BindingStorageClass (Direct / UniqueHeap / SharedCow / SharedAtomic / SharedAtomicMut) inline. Rendered with [… approx] because the authoritative classifier lives in the bytecode compiler.

Example settings.json enabling the storage-class hint:

{
"shape.inlayHints.bindingStorageClass.enable": true
}
  1. Open any .shape file
  2. Check the status bar — you should see Shape Language Server running
  3. Hover over a function or type to verify LSP hover works
  4. Introduce a deliberate syntax error and verify red squiggles appear
  • Verify shape-lsp is on your PATH: run shape-lsp --version in your terminal
  • Check the Output panel (Ctrl+Shift+U) and select “Shape Language Server” for error messages
  • Restart the extension: Ctrl+Shift+P → “Developer: Reload Window”
Terminal window
cargo install shape-lsp --force

Then reload VS Code.