Language Server Protocol implementation for Hurl
Bringing first-class editor intelligence to .hurl files —
diagnostics, completion, formatting, outline, and more.
简体中文文档:README.zh-CN.md
⚠️ Work in Progress —hurl-lspis under active development. Core features are being implemented. Not yet recommended for production use. Feedback and contributions are welcome.
Hurl is a powerful tool for running HTTP requests defined in plain text .hurl files. These files are version-controlled alongside your code, making them ideal for API testing in CI/CD pipelines.
Until now, editing .hurl files in any editor meant writing in the dark — no completions, no diagnostics, no inline docs. hurl-lsp fills that gap.
Built in Rust on top of tower-lsp and the official hurl_core parser, hurl-lsp is currently focused on a solid v0 baseline: core LSP features plus a working VSCode extension.
Current implementation status:
- Rust language server with diagnostics, completions, hover, formatting, outline, and variable definition jump
- VSCode extension with
.hurllanguage registration, TextMate grammar, snippets, and language client - VSCode binary bootstrap for macOS / Linux / Windows
- Zed extension skeleton and Helix setup docs in-repo
Not implemented yet:
- Rich per-assert actual-value inline rendering
- TestMind integration
Real-time diagnostics while editing .hurl files:
- Parser-backed syntax errors from
hurl_core - Invalid HTTP method detection
- Invalid section name detection
- Undefined variable warnings (
{{variable}}) - Duplicate section warnings in one request block
- Invalid
HTTPstatus code format detection
Context-aware completions triggered automatically:
- HTTP Methods —
GET,POST,PUT,DELETE,PATCH, ... - Section Keywords —
[Query],[Form],[Multipart],[Headers],[Captures],[Asserts],[Options], ... - Assert Functions —
jsonpath,xpath,regex,header,status,duration, ... - Content-Type values — common MIME types for request headers
- Captured Variables —
{{context completion from same-file[Captures]
Hover over methods, sections, and assert functions to see short inline docs.
Variable references can jump to their same-file [Captures] definition.
When workspace variable files exist (.hurl-vars, vars.env, hurl.env, .env), definition and diagnostics can also resolve against those files.
Resolved values are previewed as inline hints. Sensitive names such as tokens, passwords, and authorization values are masked. Configure this with hurl.variables.inlayHints.enabled and hurl.variables.inlayHints.maxLength.
Per-request Code Lens is available with:
- summary line (
method/path, section counters) ▶ Runaction (executes selected request entry via temporary hurl file)⚡ Run with varsaction (merges effective.hurl-vars/vars.env/hurl.env/.envvalues using workspace precedence)⛓ Run chainaction (executes current entry plus inferred/declared dependencies)📄 Run fileaction (executes all request entries in current file)📋 Copy as curlaction (resolves workspace variables, copies directly to the clipboard, and opens the cURL Inspector view)
Run alert behavior:
hurl.run.inlineFailureDiagnostics:true(default) shows inline red failure diagnostics; set tofalseto disable themHurl: Clear Run Alerts: clears current file's run diagnostics immediately
When openapi.yaml / openapi.yml / swagger.yaml / swagger.yml / swagger.json is present in the workspace hierarchy,
request lines can use OpenAPI paths keys for URL completion.
For mapped operations, request body field names from OpenAPI requestBody.content.application/json.schema.properties
are also suggested inside JSON request bodies.
Format Document is backed by official hurlfmt::format::format_text(..., false) through LSP.
Use command Hurl: Format Document for explicit formatter invocation with runtime logging.
Command Hurl: Export as Markdown exports current .hurl file into a sibling .md file.
The export follows outline preferences:
hurl.outline.groupMode:hierarchical|flathurl.outline.sortMode:source|priority
Command Hurl: Open Inspector opens a side panel with:
Request: request details and Run / Run with vars / Run Chain / Copy as cURL actionsChain: entry list plus inferred and explicit dependency edgesResult: structured request and response headers/body, JSON formatting, assertions, raw output, and the latest 10 in-memory runscURL: complete generated command, masked secret preview, reveal/hide, and copy again
Copy as cURL is static and never sends a network request. It supports URL, headers, query, Basic Auth, JSON/XML/text bodies, forms, and multipart requests. Runtime captures and built-in dynamic values must be available as static variables before copying.
The server exposes metadata-first document symbols with request-level fallback:
📁 users.hurl
├── 🔗 TC-CHAIN-001 用户完整生命周期 [P0]
│ ├── 🔧 Create user step-setup
│ └── 🧪 Validate user step-test
├── 🟧 P1
│ └── TC-0042 Invalid email
└── ○ GET /health
Outline behavior is configurable in VSCode settings:
hurl.outline.groupMode:hierarchicalkeeps chain/priority groups,flatshows request entries onlyhurl.outline.sortMode:sourceuses file order,prioritysorts byP0 > P1 > P2(with step ordersetup > test > teardown)
In VSCode Explorer, Hurl Requests view provides executable request nodes with inline actions:
Run(executes selected request)Run Chain(executes selected request + inferred/declared dependencies)
| Editor | Status | Notes |
|---|---|---|
| VSCode | Implemented | Extension included in editors/vscode, with local binary config and cross-platform auto-download flow |
| Helix | Implemented (manual setup) | Guide available at editors/helix/README.md |
| Neovim | Manual setup | Server is usable manually via LSP config |
| Zed | Baseline implemented | Minimal extension skeleton in editors/zed (publish pending) |
Current automatic binary management in the VSCode extension supports:
aarch64-apple-darwinx86_64-apple-darwinx86_64-unknown-linux-gnux86_64-pc-windows-msvc
Install the Hurl LSP extension from the VS Marketplace or Open VSX (VSCodium). Search for hurl-lsp / Hurl.
Listing copy lives in editors/vscode/README.md.
Or install from .vsix package generated by the release workflow.
Binary resolution order:
- Use
hurl.server.pathif configured. - Check
hurl-lspin localPATHand reuse it when version is >= extension version. - Otherwise auto-download matching release binary.
Use command Hurl: Show Log to open extension/runtime logs.
Install the Hurl extension from Zed Extensions, then install the binary:
cargo install hurl-lspInstall the binary, then add to ~/.config/helix/languages.toml:
[[language]]
name = "hurl"
scope = "source.hurl"
file-types = ["hurl"]
comment-token = "#"
language-servers = ["hurl-lsp"]
[language-server.hurl-lsp]
command = "hurl-lsp"require('lspconfig').hurl_lsp.setup({
cmd = { "hurl-lsp" },
filetypes = { "hurl" },
})Via cargo:
cargo install hurl-lspVia Homebrew:
brew tap testmind-hq/tap
brew install hurl-lspHomebrew formula is maintained in testmind-hq/homebrew-tap and updated automatically on each release.
Pre-built binaries for macOS (Intel + Apple Silicon), Linux, and Windows are available on the Releases page.
CI result feedback integration from TestMind is a future phase and is not implemented in current builds.
- Project scaffolding (Cargo workspace + tower-lsp)
- Document state management (
did_open/did_change) - Syntax diagnostics via
hurl_core - HTTP method + section keyword completion
- Assert function completion
- Hover documentation
- Built-in formatter (
hurlfmt) - CI (build + test + clippy)
- Multi-platform cross-compilation workflow baseline + GitHub Releases automation
- VSCode extension (syntax highlight + snippets + LSP client + auto binary management)
- [~] Publish to VS Marketplace (workflow prepared:
.github/workflows/publish-vscode.yml) - Zed extension (syntax highlight + LSP client) baseline skeleton
- Publish to Zed Extensions
- [~] Helix configuration docs + upstream PR to
languages.toml(docs done, upstream PR pending) - [~] Publish to crates.io (workflow prepared:
.github/workflows/publish-crates-io.yml)
- Variable file integration (workspace env files + cross-file resolution)
- Code Lens — run/run-with-vars/copy-as-curl + dependency annotation + last-run status summary
- Inline execution result display (run failures map to assert-line diagnostics with persisted summary state)
- OpenAPI / Swagger integration (path + request-body-field completion + response assert skeleton completion)
- Document outline with metadata support (
documentSymbol) - Chain case detection and dependency annotation
- [~] VSCode Webview panel (single request + dependency graph baseline)
- Markdown export command (group/sort aware)
- Homebrew distribution (release workflow auto-updates tap formula with checksums)
- Upstream PR to Hurl official docs (editor support page)
- TestMind CI result feedback integration
hurl-lsp is built in Rust using:
| Crate | Role |
|---|---|
tower-lsp |
Async LSP server framework |
hurl_core |
Official Hurl parser and AST |
tokio |
Async runtime |
dashmap |
Concurrent document state store |
The server communicates via stdin/stdout JSON-RPC, launched as a subprocess by the editor. No daemon, no ports, no configuration required to get started.
hurl-lsp/
├── crates/
│ └── hurl-lsp/ # LSP server core (Rust)
│ └── src/
│ ├── main.rs
│ ├── backend.rs
│ ├── diagnostics.rs
│ ├── completion.rs
│ ├── hover.rs
│ ├── formatting.rs
│ ├── symbols.rs
│ ├── metadata.rs
│ └── definition.rs
├── editors/
│ ├── vscode/ # VSCode extension (TypeScript)
│ ├── zed/ # Zed extension skeleton (Rust)
│ └── helix/ # Helix setup docs
└── .github/
└── workflows/
├── ci.yml
├── publish-crates-io.yml
├── publish-vscode.yml
└── release.yml
Contributions are welcome. If you plan to work on a significant feature, please open an issue first to discuss the approach.
git clone https://github.com/testmind-hq/hurl-lsp
cd hurl-lsp
cargo build
cargo test
cargo clippy| Project | Description |
|---|---|
| Hurl | The HTTP testing tool this LSP supports |
| CaseForge | AI-powered test case generation for Hurl |
| TestMind | Test case management and CI integration platform |
| taplo | Inspiration — a well-crafted LSP for TOML in Rust |
| Even Better TOML | Reference for VSCode extension + binary management pattern |
MIT (see LICENSE).
