WarpLabs
WFL, WFS, WPL, OML, WFG, GXL, and MoJu language support for WarpLabs
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for WarpLabs. The extension's id is warplabs.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
WarpLabs Zed Extension
Zed editor extension for WarpLabs DSLs — syntax highlighting, diagnostics, completion, hover, go-to-definition, find references, rename, document symbols, and formatting.
Supported Languages
| Language | Suffix | Description |
|---|---|---|
| WFL | .wfl | WarpFusion Language — fusion rules, pattern detection, scoring |
| WFS | .wfs | Window Field Schema — event stream window and field definitions |
| WPL | .wpl | WarpLabs Parsing Language — log parsing with transformation pipelines |
| OML | .oml | Output Mapping Language — output mapping and transformations |
| WFG | .wfg | WarpFusion scenario Generator — test scenario generation and fault injection |
| MoJu | .mju | MoJu design language — structure, lifecycles, flows, architecture, and verification |
Features
Syntax Highlighting
Tree-sitter-based highlighting for all supported languages, including keywords, types, strings, numbers, comments, operators, and built-in functions.
Language Server (wplabs-lsp)
The extension integrates with wplabs-lsp, a Language Server Protocol server that provides:
| Feature | Description |
|---|---|
| Diagnostics | Real-time syntax error detection from tree-sitter ERROR/MISSING nodes |
| Completion | Keywords, built-in functions/types, document identifiers |
| Hover | Documentation for keywords, built-in function signatures, identifier context |
| Go to Definition | Jump to rule, window, scenario, package declarations (Cmd+Click / F12) |
| Find References | Find all usages of a symbol (Shift+F12) |
| Rename | Rename symbol across all definition and reference sites (F2) |
| Document Symbols | Outline view of rules, windows, contracts, scenarios (Cmd+Shift+O) |
| Formatting | Indent-based document formatting (Cmd+Shift+I) |
Other
- Bracket matching and auto-close
- Auto-indentation
- Code folding
- Code snippets (OML)
Installation
1. Install wplabs-lsp
The LSP binary must be in your PATH.
From source:
cd tools/wplabs-lsp
cargo build --release
# Copy or symlink to a directory in your PATH
cp target/release/wplabs-lsp /usr/local/bin/
# or
ln -s "$(pwd)/target/release/wplabs-lsp" /usr/local/bin/wplabs-lsp
Via cargo install (after publishing to crates.io):
cargo install wplabs-lsp
Verify:
wplabs-lsp --version # or just: which wplabs-lsp
2. Install the Zed Extension
From Zed Extension Marketplace (after publishing):
Cmd+Shift+X → search "WarpLabs" → Install
As Dev Extension (for development):
Cmd+Shift+P → "zed: install dev extension" → select tools/zed-warplabs/
3. Verify
Open any .wfl, .wfs, .wpl, .oml, .wfg, .gxl, or .mju file. You should see:
- Syntax highlighting immediately
- LSP status "WarpLabs LSP" in the status bar for languages handled by
wplabs-lsp - Diagnostics (red underlines) for syntax errors
- Completions when typing
MoJu .mju support is currently syntax-only in this extension.
Language Reference
WFL — Keywords & Built-ins
Keywords: use, rule, meta, events, match, keys, duration, on, event, close, score, entity, yield, contract, given, expect, derive, stage, and, or, not, in, true, false, if, then, else, join, conv
Aggregates: count, sum, avg, min, max, distinct
Functions: fmt, has, Now::time, Now::date, Now::hour
Types: chars, digit, float, bool, time, ip, hex
WFS — Keywords & Types
Keywords: window, stream, time, over, fields, array
Types: chars, digit, float, bool, time, ip, hex
WPL — Keywords & Types
Keywords: package, rule, field, metadata, length, format, pipe, separator, target, type, tag, copy_raw, alt, opt, some_of, seq, not
Types: chars, digit, float, bool, time, ip, hex, json, kvarr, http/request, http/status, http/agent
OML — Keywords & Pipe Functions
Keywords: name, rule, read, take, pipe, fmt, object, collect, match, select, from, where, and, or, not, in, auto, ip, chars, digit, float, time, bool, obj, array
Pipe functions: to_json, base64_decode, base64_encode, url, nth, get, path, json_escape, json_unescape, html_unescape, html_escape, str_escape, to_str, skip_empty, ip4_to_int, Time::to_ts_ms
WFG — Keywords & Generator Functions
Keywords: use, scenario, seed, time, duration, total, stream, inject, for, on, faults, oracle, hit, near_miss, non_hit, true, false, out_of_order, late, duplicate, drop
Generator functions: ipv4, pattern, uniform, choice, counter, normal, zipf
MoJu — Keywords
Keywords: struct, state, event, error, command, actor, lifecycle, cap, op, flow, verify, layer, dependency_rule, module, decision, depends, implements, require, step, ensure, mock, expect
Troubleshooting
LSP not starting
Check that wplabs-lsp is in your PATH:
which wplabs-lsp
Check Zed logs for errors: Cmd+Shift+P → "zed: open log"
LSP running but no diagnostics
The LSP only reports tree-sitter parse errors (ERROR/MISSING nodes). If the file parses correctly, there will be no diagnostics — this is expected.
Debug LSP
Run with logging enabled:
RUST_LOG=debug wplabs-lsp
Manual protocol test:
printf 'Content-Length: 80\r\n\r\n{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}' \
| wplabs-lsp
Grammar changes not reflected
After modifying a tree-sitter grammar:
tree-sitter generatein the grammar repogit committhe changes- Update
revinextension.tomlto the new commit hash - Reinstall the dev extension in Zed
Validate grammar + language query compatibility
Run this before pushing grammar/highlighting changes:
bash scripts/check-grammar-highlights.sh
This check will, for each language in extension.toml:
- clone the pinned grammar repo/revision,
- parse all
examples/<lang>/*.langfiles, - compile and run all
languages/<lang>/*.scmquery files against those examples.
Project Structure
tools/
├── zed-warplabs/ # This Zed extension
│ ├── extension.toml # Extension manifest
│ ├── Cargo.toml # Rust WASM extension (for LSP integration)
│ ├── src/lib.rs # Extension trait implementation
│ ├── languages/ # Per-language Zed configs
│ │ ├── wfl/ # config.toml + highlights/brackets/indents/folds/outline .scm
│ │ ├── wfs/
│ │ ├── wpl/
│ │ ├── oml/
│ │ └── wfg/
│ ├── grammars/ # Pre-built WASM parsers
│ ├── snippets/ # Code snippets
│ └── examples/ # Example files for testing
│
├── wplabs-lsp/ # Language Server binary
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs # Stdio transport entry point
│ ├── server.rs # tower-lsp LanguageServer implementation
│ ├── capabilities.rs # LSP capability declarations
│ ├── dispatch.rs # Route requests by language
│ ├── document.rs # Document state (text + tree-sitter tree)
│ ├── util.rs # tree-sitter ↔ LSP type helpers
│ ├── lang/ # Per-language handlers
│ │ ├── mod.rs # LangHandler trait
│ │ ├── wfl.rs
│ │ ├── wfs.rs
│ │ ├── wpl.rs
│ │ ├── oml.rs
│ │ └── wfg.rs
│ └── features/ # LSP feature implementations
│ ├── diagnostics.rs
│ ├── completion.rs
│ ├── hover.rs
│ ├── definition.rs
│ ├── references.rs
│ ├── rename.rs
│ ├── symbols.rs
│ └── formatting.rs
│
├── tree-sitter-wfl/ # Tree-sitter grammars
├── tree-sitter-wfs/
├── tree-sitter-wpl/
├── tree-sitter-oml/
├── tree-sitter-wfg/
└── tree-sitter-moju/
License
Apache-2.0