Tarantool extension for the Zed editor providing Lua snippets, EmmyLua type annotations, LSP integration, and debugging support for Tarantool application development.
-
40+ Tarantool-specific snippets covering:
box.spaceCRUD operations (select, insert, replace, update, delete, upsert, get, count, pairs)- Schema management (space creation, index creation,
box.once) - Transaction management (
box.begin,box.atomic) - Fiber operations (create, sleep, conditions, channels)
net.boxremote connections and callscrudmodule operationsvshardrouter calls- HTTP server patterns
- Utility modules:
log,json,yaml,clock,datetime,decimal,uuid,buffer - EmmyLua type annotations (
---@class,---@param,---@return)
-
EmmyLua type annotations for Tarantool builtin modules:
box,buffer,clock,config,console,csv,datetime,decimalerrno,fiber,fio,fun,iconv,jit,json,logsocket,strict,string,tarantool,uri,uuid,xlog,yamlhttp.client,net.boxvshard
-
LSP integration with
lua-language-server(automatic detection from PATH)- LuaJIT runtime version
- Tarantool globals (
box,_TARANTOOL) - Auto-configures annotation library paths
-
Rust toolchain with
rustup(Zed compiles extensions to WebAssembly):curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installation, restart your shell or run:
source "$HOME/.cargo/env"
Note for Homebrew users: If you previously installed Rust via
brew install rust, the Homebrew package does not always includerustup. You can either uninstall it (brew uninstall rust) and use rustup instead, or install rustup alongside it:brew install rustup rustup-init
-
WASM compilation target:
rustup target add wasm32-wasip2
-
lua-language-server:# macOS brew install lua-language-server # Linux # Download from: https://github.com/LuaLS/lua-language-server/releases
As a dev extension:
- Clone this repository with submodules:
git clone --recursive https://github.com/tarantool/tarantool-zed.git
- In Zed, open the Extensions page (
Cmd+Shift+X) - Click "Install Dev Extension" and select the
tarantool-zeddirectory
From the Zed marketplace (once published):
- Open the Extensions page (
Cmd+Shift+X) - Search for "Tarantool"
- Click Install
Type the snippet prefix and press Tab to expand. Examples:
| Prefix | Description |
|---|---|
box.select |
box.space select query |
box.insert |
box.space insert a tuple |
box.once |
Schema migration pattern |
box.begin |
Begin/commit transaction |
fiber.create |
Create and start a fiber |
vshard.call |
vshard router call |
crud.select |
CRUD select operation |
---@func |
EmmyLua annotated function |
---@class |
EmmyLua class type definition |
The extension automatically configures lua-language-server with:
- Runtime: LuaJIT
- Library paths pointing to Tarantool type annotations
- Global recognition of
boxand_TARANTOOL
To manually configure additional settings, create a .luarc.json in your
project root:
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime.version": "LuaJIT",
"workspace.library": [
"tarantool-vscode/tarantool-annotations/Library",
"tarantool-vscode/tarantool-annotations/Rocks"
],
"diagnostics.globals": ["box", "_TARANTOOL"]
}tarantool-zed/
βββ extension.toml # Extension manifest
βββ Cargo.toml # Rust dependencies (WASM build)
βββ LICENSE # MIT License
βββ src/
β βββ lib.rs # LSP configuration via Rust/WASM
βββ languages/
β βββ lua/
β βββ config.toml # Extends the built-in Lua language
βββ snippets/
β βββ tarantool-lua.json # 47 Tarantool-specific code snippets
βββ tarantool-vscode/ # Git submodule β tarantool/tarantool-vscode
β βββ tarantool-annotations/ # EmmyLua type annotations (shared with VSCode ext)
β βββ Library/ # Tarantool builtin modules
β βββ Rocks/ # Tarantool rock modules (vshard)
- Phase 2: Debugger β EmmyLua debugger adapter integration
- Phase 3: Tasks β Pre-configured Zed tasks for
ttCLI commands - Phase 4: YAML β Schema validation for Tarantool cluster configs
Contributions are welcome! Feel free to open issues or pull requests.
MIT β see LICENSE for details.
The EmmyLua type annotations in annotations/ are derived from the
Tarantool VSCode extension.