# Using Nextflow Language Server in editors that support LSP but are not VSCode

**URL:** <https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373>\
**Category:** Ask for help\
**Tags:** vscode\
**Created:** [November 6, 2024, 2:13pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373 "2024-11-06T14:13:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [November 6, 2024, 2:13pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/1 "2024-11-06T14:13:35Z")

</div>

Hi all,

First, just wanted to say fantastic work with the new VSCode language server. This is a game-changer for me and my lab’s productivity with the language, and will help shift us from Snakemake to Nextflow even more decisively.

I’ve become an avid user of the Helix editor and occasionally the Zed editor for collaborative editing, both of which support LSP out of the box. Would you have any advice on using the new Nextflow language server in these editors without going through the VSCode extension marketplace? In my perfect world, the language server would be installable through VSCode _or_ a package manager like Homebrew or Nix, as language servers like Ruff are.

Thanks again for your great work!

–Nick

---

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [November 6, 2024, 4:21pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/2 "2024-11-06T16:21:51Z")

</div>

Update: I just saw [this issue](https://github.com/nextflow-io/language-server/issues/56) in the [language-server repo](https://github.com/nextflow-io/language-server), which addresses this exact question. I’ll post here again if and when I get a Helix and Zed configuration going for anyone who’s interested!

---

<div class="post-metadata">

**Author:** ![kenibrewer](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/kenibrewer/32/963_2.png) [@kenibrewer](https://community.seqera.io/u/kenibrewer)\
**Post date:** [November 7, 2024, 3:02pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/3 "2024-11-07T15:02:39Z")

</div>

Thanks so much for the kind words Nick! We passed your comments on to the team, and they were really excited to hear the language server is having a big impact on your lab’s producitivity. 😃

And thanks for being willing to report back on the Helix / Zed configuration if you get that to work!

---

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [April 22, 2025, 3:53pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/4 "2025-04-22T15:53:57Z")

</div>

Finally following up with my Helix configuration, which more or less exactly copies the configuration in [this thread on GitHub](https://github.com/nextflow-io/language-server/issues/56#issuecomment-2748838798).

Since the nextflow language server isn’t available on Homebrew or other package managers yet, your first step will need to be cloning the source and building it yourself with Gradle. As the README says, this will involve cloning the nextflow source too.

```bash
# download the source code
git clone https://github.com/nextflow-io/language-server.git

# change into the source root directory
cd language-server

# clone Nextflow repository
git clone https://github.com/nextflow-io/nextflow ../nextflow

# build language server
make

```

`make` assumes you have gradle installed. Once it has built, the language server can be run with `java -jar build/libs/language-server-all.jar`.

To make this accessible to Helix, I just put that a shell script called `nextflow-language-server` that looks like this:

```auto
#!/bin/bash

java -jar $HOME/language-server/build/libs/language-server-all.jar

```

After running `chmod +x nextflow-language-server` and placing it somewhere that’s on `$PATH`, it should be available to Helix (or whatever else).

In my Helix `languages.toml`, I can set it up like so:

```toml
[[language]]
file-types = ["nf", "nf.test", {glob = "nextflow.config"}]
auto-format = false
language-servers = ["nextflow-language-server"]
name = "nextflow"
grammar = "groovy"
scope = "source.nextflow"
comment-tokens = ["//"]
block-comment-tokens = { start = "/*", end = "*/"}
indent = { tab-width = 4, unit = " " }

[language-server.nextflow-language-server]
command = "nextflow-language-server"

[language-server.nextflow-language-server.config.nextflow]
debug = true

[language-server.nextflow-language-server.config.nextflow.files]
exclude = [".pixi", ".git", ".nf-test", "work"]

[language-server.nextflow-language-server.config.nextflow.formatting]
harshilAlignment = true

```

(for anyone interested, my full Helix language config is [here](https://github.com/nrminor/.dotfiles/blob/c320463b99cbf2e277126e3eb785156b465d3d9b/.config/helix/languages.toml))

One of the more important lines is `grammar = "groovy"`, which tells Helix to use the Groovy tree-sitter grammar for syntax highlighting. This only work if you’ve pulled and built available tree-sitter grammars with:

```auto
hx --grammar fetch
hx --grammar build

```

That should do it! In the near future, the Nextflow LS and a tree-sitter grammar will be available on package managers like Homebrew or Nixpkgs so folks don’t have to build source themselves, but for now, this system works!

---

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [April 22, 2025, 4:01pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/5 "2025-04-22T16:01:21Z")

</div>

I’ve also attempted to write a similar setup for Zed, but it’s not working yet, with the key missing link being how to get tree-sitter grammar wired up correctly.

Here’s what I have so far in Zed’s `settings.json`:

```jsonc
    /// LSP setup for the language server
    "lsp": {
        "nextflow-language-server": {
            // in theory this calls the shell script I set up above
            "command": "nextflow-language-server",

            // probably an incorrect attempt to specify LS configs
            "config": {
                "nextflow": {
                    "debug": true,
                    "formatting": {
                        "harshilAlignment": true
                    }
                }
            }
        }
    },
    "languages": {
        "Nextflow": {
            "tab_size": 4,
            "preferred_line_length": 100,
            "format_on_save": "off",

            // plugging in the nextflow-language-server configured above here
            "language_servers": ["nextflow-language-server"]
        },
    }

```

---

<div class="post-metadata">

**Author:** ![bentsherman](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/bentsherman/32/52_2.png) [@bentsherman](https://community.seqera.io/u/bentsherman)\
**Post date:** [April 22, 2025, 7:09pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/6 "2025-04-22T19:09:06Z")

</div>

You can download the JAR from the [releases](https://github.com/nextflow-io/language-server/releases) page, no need to build from source

---

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [April 22, 2025, 7:13pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/7 "2025-04-22T19:13:31Z")

</div>

Thanks @bentsherman - I will definitely use that moving forward!

---

<div class="post-metadata">

**Author:** ![DLBPointon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/dlbpointon/32/1830_2.png) [@DLBPointon](https://community.seqera.io/u/DLBPointon)\
**Post date:** [May 30, 2025, 9:16am UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/8 "2025-05-30T09:16:31Z")

</div>

Hi @nrminor

Did you get anywhere with this? Me and a couple others in my lab are avid Zed users now, but staring at grey text for debugging is painful to say the least.

I’ve tried my own go at making a Zed plugin, but i’m not finding the language server stuff easy to wrap my head around. If not, then I’m happy to keep working on it my self.

Thanks

---

<div class="post-metadata">

**Author:** ![nrminor](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/nrminor/32/296_2.png) [@nrminor](https://community.seqera.io/u/nrminor)\
**Post date:** [June 25, 2025, 9:12pm UTC](https://community.seqera.io/t/using-nextflow-language-server-in-editors-that-support-lsp-but-are-not-vscode/1373/9 "2025-06-25T21:12:12Z")

</div>

Hi @DLBPointon -

Apologies for missing this! I unfortunately haven’t gotten the Nextflow server working in Zed. Pointing a language server executable at a file is easy enough at Zed, but as you say, their extension system makes it more complicated to wire up treesitter than it is with Helix. I’d be very interested if you did figure it out, though. I too have labmates whose only attachment to VSCode at this point is Nextflow.

Amazingly, it looks like someone got to making [a Snakemake extension](https://github.com/lvignoli/zed-snakemake) before they got to nextflow, though it appears to be _only_ a tree-sitter grammar and not a grammer+server. Perhaps with the right [grammar](https://github.com/matthuska/tree-sitter-nextflow/tree/main/queries) for nextflow, it would be relatively straightforward to do something similar?

I’ll give it a shot too when I have a chance.

–Nick
