Skip to content

Editor Integration

scaf provides excellent editor support through tree-sitter grammar, LSP, and editor plugins.

tree-sitter-scaf

Tree-sitter grammar for syntax highlighting and code navigation.

Learn more →

scaf-lsp

Language server providing diagnostics, hover info, and more.

Learn more →

scaf.nvim

Neovim plugin with tree-sitter, LSP, and neotest integration.

Learn more →

The fastest way to get started with Neovim:

-- lazy.nvim
{
"rlch/scaf.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function()
require("scaf").setup({})
end,
}

Then run :TSInstall scaf.

See Neovim setup for full details.

Any editor supporting tree-sitter or LSP can use:

  • tree-sitter-scaf for highlighting
  • scaf-lsp for diagnostics

Full scaf DSL highlighting:

  • Keywords (query, test, group, setup, etc.)
  • Strings and raw strings
  • Numbers and booleans
  • Comments
  • Parameters ($param)

Query bodies are highlighted using their dialect:

  • Cypher queries get Cypher highlighting
  • SQL queries get SQL highlighting

The dialect is determined from the database in .scaf.yaml:

  • neo4j: → Cypher highlighting
  • postgres: / mysql: / sqlite: → SQL highlighting

The language server provides:

  • Diagnostics — Parse errors, undefined references
  • Hover — Information about queries, tests
  • Go to Definition — Navigate to query definitions
  • Document Symbols — Outline view of tests

Run tests directly from Neovim:

  • Test discovery in the sidebar
  • Run individual tests or groups
  • See pass/fail status inline
  • View test output
EditorRequirements
Neovim>= 0.9.0, nvim-treesitter
VS Code(Planned)
Emacstree-sitter support
Helixtree-sitter built-in
Zedtree-sitter built-in
  1. Ensure tree-sitter-scaf is installed
  2. Check filetype: :set ft? should show scaf
  3. Run :TSInstall scaf
  1. Verify scaf-lsp is in PATH: which scaf-lsp
  2. Check LSP logs: :LspLog in Neovim
  3. Try manual start: require("scaf").start_lsp()
  1. Check .scaf.yaml database setting (e.g., neo4j: for Cypher)
  2. Clear cache: :lua require("scaf").clear_cache()