Nextflow language support for Zed, powered by:
- The Nextflow language server (
nextflow-io/language-server) - Tree-sitter syntax parsing (
nextflow-io/tree-sitter-nextflow)
This extension provides Nextflow file recognition, syntax highlighting/folding, bracket auto-closing, and LSP-backed editor features.
- Language registration for
*.nffiles and Nextflow shebang scripts - Syntax highlighting via Tree-sitter queries in
languages/nextflow/highlights.scm - Code folding via Tree-sitter queries in
languages/nextflow/folds.scm - Language server integration for completions and language intelligence
- Automatic language server download on first use:
- Fetches the latest release from
nextflow-io/language-server - Downloads
language-server-all.jar - Starts it with
java -jar ...
- Fetches the latest release from
- Zed
javaavailable in yourPATH(required to run the Nextflow language server JAR)- Rust toolchain (only needed if you want to build the extension locally)
- Clone this repository.
- Build the extension WebAssembly artifact:
cargo build --release --target wasm32-wasip2
cp target/wasm32-wasip2/release/my_zed_nextflow.wasm extension.wasm- In Zed, load this folder as a dev extension (Extensions UI).
- Open a
.nffile.
On first activation, the extension downloads language-server-all.jar and then launches it with Java.
| Component | Requirement | Notes |
|---|---|---|
| Zed | Recent stable release | Extension API dependency is zed_extension_api = 0.7.0 |
| Java | java in PATH |
Required to run language-server-all.jar |
| Rust (dev only) | Stable toolchain | Needed to build extension.wasm locally |
| Nextflow language server | Latest GitHub release | Downloaded automatically at first run |
| OS | Linux / macOS expected, Windows untested | Runtime command currently uses /bin/sh -c |
# Fast compile check for the extension crate
cargo check
# Build production wasm artifact used by Zed
cargo build --release --target wasm32-wasip2
# Copy build artifact to the extension root
cp target/wasm32-wasip2/release/my_zed_nextflow.wasm extension.wasmThe repository includes helper binaries under src/bin that are gated behind the native-helpers feature:
cargo run --features native-helpers --bin debug
cargo run --features native-helpers --bin real_donwloaderThese binaries are for local debugging/downloading experiments and are not part of the wasm extension runtime.
extension.toml- Zed extension metadata and grammar/LSP wiringsrc/lib.rs- Main extension implementation (download + launch language server)languages/nextflow/config.toml- Language config (suffixes, brackets, comments)languages/nextflow/highlights.scm- Highlight query ruleslanguages/nextflow/folds.scm- Folding query rulesgrammars/nextflow/- Tree-sitter grammar source checkout
- The grammar revision is pinned in
extension.toml. - The language server JAR is downloaded from the latest GitHub release and stored in the extension's writable runtime directory.
- Install a JRE/JDK and ensure
javais available in your shellPATH. - Verify with:
java -version- Confirm network access to GitHub releases (
nextflow-io/language-server) on first run. - Rebuild and refresh the wasm artifact:
cargo build --release --target wasm32-wasip2
cp target/wasm32-wasip2/release/my_zed_nextflow.wasm extension.wasm- Reload the extension in Zed and reopen a
.nffile.
- Confirm the grammar and query files are present:
languages/nextflow/config.tomllanguages/nextflow/highlights.scmlanguages/nextflow/folds.scm
- Rebuild
extension.wasm, reload the extension, and reopen the file.
This project is licensed under the MIT License.
See LICENSE for details.
- Ensure
extension.wasmis rebuilt from current sources. - Validate extension metadata in
extension.toml(id,version,repository,description). - Smoke-test by opening a
.nffile in a clean Zed profile and confirming LSP startup/completions. - Add CI workflow(s) in
.github/workflows/, then wire status badges in this README.