Editor Setup: LSP, VS Code, and Tree-sitter

Dippin ships with a built-in Language Server Protocol (LSP) server and a VS Code extension. Together they give you real-time diagnostics, hover documentation, go-to-definition, autocomplete, and syntax highlighting -- the same checks you'd get from dippin lint, but live as you type.

The LSP Server

The LSP server is built into the dippin binary. No separate install needed:

$ dippin lsp

Starts the server on stdio (stdin/stdout), speaking JSON-RPC 2.0 per the LSP spec. Any editor with LSP support can connect.1

What the LSP Provides

Diagnostics

Parse errors and all 34 lint warnings (DIP001-DIP125) on every keystroke. Same checks as dippin lint.

Hover

Hover over a node name to see its kind, model, provider, prompt preview, and field summary.

Go-to-definition

Click a node reference in an edge declaration to jump to the node's definition.

Autocomplete

Node IDs in edge declarations, field names within node blocks, and Dippin keywords.

Document Symbols

Outline view showing all nodes and the edges section for quick navigation.

Real-time Feedback

Diagnostics update as you type -- same as running dippin lint on every save.

Universal configuration

For any editor, the LSP config is always the same: command is dippin lsp, transport is stdio, file type is .dip. See the editors reference for more detail.

VS Code

VS Code

Install the Extension

The VS Code extension lives in the repository at editors/vscode/. It provides syntax highlighting independently of the LSP server. For the best experience, install both.

Symlink into your VS Code extensions directory:

$ ln -s "$(pwd)/editors/vscode" ~/.vscode/extensions/dippin-lang

Or copy it:

$ cp -r editors/vscode ~/.vscode/extensions/dippin-lang

Restart VS Code. Open any .dip file -- the status bar should show "Dippin" as the language mode.

What Gets Highlighted

The TextMate grammar covers all Dippin syntax elements:

ElementExampleCategory
Keywordsworkflow, agent, tool, human, edgeskeyword
Node namesagent MyNodefunction
Field keysmodel:, prompt:, timeout:tag
Strings"quoted value"string
Comments# commentcomment
Arrows->, <-operator
Conditionswhen, and, or, notkeyword
Variablesctx.outcome, ${ctx.var}variable
Booleanstrue, falseconstant
Numbers3, 60s, 5mnumber

Connect the LSP

The extension includes a built-in LSP client. Add to your VS Code settings.json:

{
  "dippin.lsp.enabled": true,
  "dippin.lsp.path": "dippin"
}

dippin.lsp.path defaults to "dippin", which assumes the binary is on your $PATH. If you installed somewhere else, provide the full path.

Once connected, you'll see squiggly underlines for diagnostics, hover tooltips on node names, and autocomplete suggestions when you type edge declarations.

Extension Details

The extension is minimal by design:

FieldValue
Namedippin-lang
Display nameDippin
Version0.2.0
VS Code engine^1.75.0
ActivationonLanguage:dippin
LSP clientvscode-languageclient ^9.0.1

Neovim

Neovim

With nvim-lspconfig

Add to your Neovim configuration:

local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')

if not configs.dippin then
  configs.dippin = {
    default_config = {
      cmd = { 'dippin', 'lsp' },
      filetypes = { 'dippin' },
      root_dir = lspconfig.util.root_pattern('.git'),
      settings = {},
    },
  }
end

lspconfig.dippin.setup({})

Register the Filetype

Tell Neovim that .dip files are Dippin files:

vim.filetype.add({
  extension = {
    dip = 'dippin',
  },
})

Tree-sitter Grammar

A full tree-sitter grammar is available in editors/tree-sitter-dippin/. It includes an external scanner for Dippin's indentation-sensitive syntax and highlight queries for semantic highlighting. To use with nvim-treesitter, register the parser in your config.

The tree-sitter grammar gives more precise highlighting than the fallback syntax file, correctly handling multi-line prompt blocks, nested conditions, and indentation-based scope boundaries.2

Basic Syntax Highlighting (Fallback)

For keyword highlighting without tree-sitter, create ~/.config/nvim/syntax/dippin.vim:

syn keyword dippinKeyword workflow agent human tool parallel fan_in subgraph edges defaults
syn keyword dippinCondKeyword when and or not
syn keyword dippinBoolean true false
syn match dippinField /^\s*\w\+:/
syn match dippinArrow /->/
syn match dippinArrow /<-/
syn match dippinComment /#.*/
syn match dippinVariable /\${[^}]*}/
syn region dippinString start=/"/ end=/"/

hi link dippinKeyword Keyword
hi link dippinCondKeyword Conditional
hi link dippinBoolean Boolean
hi link dippinField Tag
hi link dippinArrow Operator
hi link dippinComment Comment
hi link dippinVariable Identifier
hi link dippinString String

Other Editors

Any LSP Editor

Any editor with LSP support can use dippin lsp. The config is always the same:

SettingValue
Commanddippin lsp
Transportstdio
File types.dip

Editors Known to Work

EditorLSP clientTree-sitter support
Sublime TextLSP packageNo
Emacslsp-mode or eglotNo
HelixNative LSPYes (register grammar)
ZedNative LSPYes (register grammar)

For Helix and Zed, register the tree-sitter grammar from editors/tree-sitter-dippin/ for full semantic highlighting alongside LSP diagnostics.

dippin watch as an Alternative

If your editor doesn't support LSP, or you just want something lightweight, dippin watch gives live feedback in a terminal pane:

$ dippin watch pipeline.dip
Watching pipeline.dip for changes...

[14:32:05] PASS  pipeline.dip  (0 errors, 0 warnings)
[14:32:18] WARN  pipeline.dip
  DIP108: node "Analyze": unknown model "gpt-4-turbo" for provider "openai"
[14:32:24] PASS  pipeline.dip  (0 errors, 0 warnings)

Run it in a split terminal next to your editor. On every save, you get instant lint results. The watcher debounces at 200ms to avoid duplicate runs when editors write multiple times on save.

Watch a whole directory:

$ dippin watch pipelines/
Watching 8 .dip files in pipelines/...

Graphviz Integration

For visual workflow diagrams alongside your editor, pipe export-dot output to Graphviz:

# PNG output
$ dippin export-dot pipeline.dip | dot -Tpng -o pipeline.png

# SVG for web
$ dippin export-dot pipeline.dip | dot -Tsvg -o pipeline.svg

# Left-to-right layout
$ dippin export-dot --rankdir=LR pipeline.dip | dot -Tpng -o pipeline.png

# Include prompt text in nodes
$ dippin export-dot --prompts pipeline.dip | dot -Tpng -o pipeline.png

Install Graphviz: brew install graphviz on macOS, apt install graphviz on Debian/Ubuntu, or visit graphviz.org.

Choosing Your Setup

A quick decision guide:

SituationRecommendation
VS Code, want the full experience Install extension + enable LSP in settings
Neovim, want the full experience nvim-lspconfig + tree-sitter grammar
Neovim, quick setup nvim-lspconfig + fallback syntax file
Helix or Zed Native LSP config + tree-sitter grammar
Editor without LSP dippin watch in a terminal pane
Highlighting only, no diagnostics VS Code extension or Vim syntax file alone

What's Next?

Your editor now has live diagnostics and syntax highlighting.

Notes

  1. The LSP server reuses the same parse and lint code paths as the CLI. When you see a diagnostic in your editor, it's the exact same check that dippin lint and CI run. No separate analysis engine, no divergence risk. The implementation is in lsp/.
  2. Dippin's indentation-based syntax (similar to Python or YAML) means a regex-based TextMate grammar can't accurately determine scope boundaries. Tree-sitter's incremental parsing handles this correctly, which is why the tree-sitter grammar gives better results for multi-line prompt: and command: blocks.