Editor Setup
Waltzing provides editor integrations for syntax highlighting and language server support.
Zed Editor
Zed has first-class support for Waltzing through an official extension.
Installation
- Open Zed and go to Extensions (Cmd+Shift+X on macOS)
- Search for "Waltzing"
- Click Install
The extension provides:
- Syntax highlighting via Tree-sitter grammar
- LSP support via
waltzing-lsp - File association for
.wtzfiles
Manual Installation
To install manually or use a development version:
Clone the extension
git clone https://git.awesomike.com/dev/waltzing
cd waltzing/extensions/zed
# Install the extension
zed --install-extension .###@
Visual Studio Code
VS Code support is available through a TextMate grammar extension.
Installation
- Open VS Code Extensions (Cmd+Shift+X on macOS)
- Search for "Waltzing"
- Click Install
LSP Configuration
To enable LSP features, add to your settings.json:
@####{
"waltzing.lsp.enabled": true,
"waltzing.lsp.path": "waltzing-lsp"
}
Make sure waltzing-lsp is installed and in your PATH. Install it with:
curl -fsSL https://waltzing.awesomike.com/install | bash -s -- --binary lspNeovim
Neovim users can use the Tree-sitter grammar for syntax highlighting and nvim-lspconfig for LSP support.
Tree-sitter Setup
Add to your init.lua or nvim-treesitter config:
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.waltzing = {
install_info = {
url = "https://git.awesomike.com/pub/waltzing-ts.git",
files = { "src/parser.c" },
branch = "main",
},
filetype = "waltzing",
}
vim.filetype.add({
extension = {
wtz = "waltzing",
},
})
Then install the parser:
:TSInstall waltzing
LSP Setup
Add to your nvim-lspconfig:
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
if not configs.waltzing_lsp then
configs.waltzing_lsp = {
default_config = {
cmd = { 'waltzing-lsp' },
filetypes = { 'waltzing' },
root_dir = lspconfig.util.root_pattern('Cargo.toml', '.git'),
},
}
end
lspconfig.waltzing_lsp.setup({})
Tree-sitter Grammar
The Waltzing Tree-sitter grammar provides accurate syntax highlighting for .wtz files.
Grammar Repository
https://git.awesomike.com/pub/waltzing-ts.git
Features
- Full support for Waltzing template syntax
- Embedded language highlighting (HTML, CSS, JavaScript)
- Control flow constructs (
@if,@for,@match) - Function definitions and function tags
- Expression highlighting with proper nesting
- Comment support (single and multi-line)
Building from Source
git clone https://git.awesomike.com/pub/waltzing-ts.git
cd waltzing-ts
npm install
npx tree-sitter generate
npx tree-sitter build-wasm
Query Files
The grammar includes query files for:
highlights.scm- Syntax highlighting queriesinjections.scm- Embedded language injectionlocals.scm- Local variable scoping
Language Server (LSP)
The Waltzing Language Server provides IDE features across all editors that support LSP.
Installation
curl -fsSL https://waltzing.awesomike.com/install | bash -s -- --binary lsp
Or build from source:
git clone https://git.awesomike.com/dev/waltzing
cd waltzing
cargo install --path lsp
Features
- Diagnostics - Real-time syntax and type error reporting
- Go to Definition - Navigate to template imports and function definitions
- Hover Information - Type information and documentation on hover
- Completion - Auto-complete for template syntax, imports, and expressions
- Document Symbols - Outline view of functions and imports
Configuration
The LSP server accepts these configuration options:
{
"waltzing": {
"templatesDir": "templates",
"diagnostics": {
"enabled": true,
"delay": 300
}
}
}
Other Editors
For editors not listed above, you can:
Use Tree-sitter Directly
If your editor supports Tree-sitter, configure it to use the Waltzing grammar:
https://git.awesomike.com/pub/waltzing-ts.git
Use LSP
Any editor with LSP support can use waltzing-lsp. Configure your editor to:
- Associate
.wtzfiles with the Waltzing language - Start
waltzing-lspfor Waltzing files
TextMate Grammar
A TextMate grammar is available for editors that support it (VS Code, Sublime Text, TextMate):
https://git.awesomike.com/dev/waltzing/tree/main/extensions/vscode
Need support for a different editor? Open an issue at git.awesomike.com/dev/waltzing/issues with details about your editor's extension format.