Reference

LSP Capabilities

Quick reference of all tarn-lsp language server features: LSP methods, supported editors, and key commands.

Feature matrix

Feature LSP Method Description
Diagnostics textDocument/publishDiagnostics Parse/schema errors on open, save, and debounced change (300ms). Sources: yaml_syntax, tarn_parse, tarn_validation.
Hover textDocument/hover Context-aware Markdown for {{ env.x }}, {{ capture.x }}, {{ $builtin }}, and JSONPath evaluation against recorded responses.
Completion textDocument/completion Env keys, capture names, built-in functions, and schema-driven YAML key completion.
Document symbols textDocument/documentSymbol Hierarchical outline: file → named tests → steps. Setup, teardown, and flat steps included.
Go-to-definition textDocument/definition Jump from {{ capture.x }} or {{ env.x }} to its declaration site.
References textDocument/references List every use site. Capture: single-test scope. Env: workspace-wide.
Rename textDocument/rename Atomic WorkspaceEdit. Capture: single file. Env: all source files + use sites.
Code lens textDocument/codeLens "Run test" / "Run step" buttons using tarn.runTest and tarn.runStep commands.
Formatting textDocument/formatting Full document formatting via tarn::format::format_document (same as tarn fmt CLI).
Code actions textDocument/codeAction Extract env var, Capture this field, Scaffold assert from last response, Apply fix (quick fix via fix_plan engine).
JSONPath evaluator workspace/executeCommand tarn.evaluateJsonpath evaluates a path against inline response or sidecar step reference.

Recorded-response sidecar

The JSONPath hover, "scaffold assert" code action, and tarn.evaluateJsonpath step reference all read from:

<file>.tarn.yaml
<file>.tarn.yaml.last-run/
  <test-slug>/
    <step-slug>.response.json

Clients write responses here after runs so hover-JSONPath lights up. The LSP is read-only against this layout.

Supported editors

Editor Setup method Notes
Claude Code Plugin marketplace Claims all .yaml/.yml files (compound-extension caveat)
opencode opencode.jsonc LSP config Same compound-extension caveat as Claude Code
VS Code Extension + optional tarn.experimentalLspClient Test explorer, live streaming, environments
Neovim vim.lsp.start + filetype rule Built-in LSP client (0.10+)
Helix languages.toml config LSP 3.17 stdio
Zed settings.json LSP block Language extension pattern
Emacs eglot / lsp-mode Register against .tarn.yaml buffers