Skip to content

Update Request: nvim-treesitter master branch → main? branch #415438

Closed

Description

@JonBoyleCoding

Nixpkgs version

  • Unstable (25.11)

Package name

nvim-treesitter

Upstream version

https://github.com/nvim-treesitter/nvim-treesitter/tree/main ? The developer has asked not to blindly do this - see my comment below.

Nixpkgs version

2025-05-24

Changelog

No response

Additional context

It looks like nvim-treesitter has changed to using main rather than master, and the current commit is from the master branch. They haven't updated the master branch in a few months other than to say they are archiving it.

The commit used is on the master branch and has a couple hundred missing commits from main.

nvim-treesitter = buildVimPlugin {
pname = "nvim-treesitter";
version = "2025-05-24";
src = fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "42fc28ba918343ebfd5565147a42a26580579482";
sha256 = "1ck1qslxwi18qxrga68blvk1dg9j4jn65xiw8snq5pk06waksnq9";
};
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter/";
meta.hydraPlatforms = [ ];
};

This causes some issues with lack of grammar updates.

I saw this referenced #411256 (comment) - but that was in an issue for treesitter not nvim-treesitter directly and has been closed.

Notify maintainers

@figsoda


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: enhancement
    9.needs: package (update)
    on Jun 9, 2025
  2. JonBoyleCoding commented on Jun 10, 2025

    @JonBoyleCoding
    ContributorAuthor

    Before blindly updating, the developer had this comment on my original issue:

    nvim-treesitter/nvim-treesitter#7944 (comment)

    No, don't do that! I do not want "distributions" blindly switching to the main branch, which is an incompatible rewrite and will be massively breaking to users.
    Instead, they should fix their mess where they do not install the parser versions that are specified here; queries are only guaranteed to be compatible with the exact commit tracked in the lockfile.

  3. changed the title [-]Update Request: nvim-treesitter `master` branch → `main` branch[/-] [+]Update Request: nvim-treesitter `master` branch → `main?` branch[/+] on Jun 10, 2025
  4. JonBoyleCoding commented on Jun 10, 2025

    @JonBoyleCoding
    ContributorAuthor

    Just for reference, my original issue was that the GDScript highlights were outdated. I see there are a number of scripts in nixpkgs, so my issue is something different to this being outdated. I don't have time to read the scripts and understand what's going on right now.

  5. guillermofbriceno commented on Aug 13, 2025

    @guillermofbriceno

    Want to add that since the verilog grammar has switched to systemverilog in both nixpkgs and nvim-treesitter main, but not master, parsing verilog is currently broken.

  6. iofq commented on Aug 14, 2025

    @iofq
    Contributor

    if anyone would like to adopt the main branch, it can be done by adding nvim-treesitter main branch to flake inputs:

    inputs = {
      nvim-treesitter = {
        url = "github:nvim-treesitter/nvim-treesitter/main";
        flake = false;
      };
    }

    and using this overlay:

    { inputs, ... }:
    final: prev:
    {
      vimPlugins = prev.vimPlugins.extend (
        final': prev': {
          nvim-treesitter = prev'.nvim-treesitter.overrideAttrs (old: rec {
            src = inputs.nvim-treesitter;
            name = "${old.pname}-${src.rev}";
            postPatch = "";
            # ensure runtime queries get linked to RTP (:TSInstall does this too)
            buildPhase = "
              mkdir -p $out/queries
              cp -a $src/runtime/queries/* $out/queries
            ";
            nvimSkipModules = [ "nvim-treesitter._meta.parsers" ];
          });
        }
      );
    }

    The buildPhase part is a bit of a hack (ideally you'd only copy grammars defined using withPlugins), and I'm not sure what this master->main migration would look like on the nixpkgs side, so I'll leave this as-is for now.

  7. PerchunPak commented on Aug 22, 2025

    @PerchunPak
    Member

    CC @NixOS/neovim

  8. mrcjkb commented on Aug 22, 2025

    @mrcjkb
    Member

    nvim-treesitter/nvim-treesitter#7895 (comment)

    We should hold off on migrating in nixpkgs until nvim-treesitter has an official release. And when that happens, we should probably pin the release tags.

    Perhaps we could create a nix-community nvim-treesitter-main overlay for users who want to use the main branch in the meantime...

  9. iofq commented on Oct 3, 2025

    @iofq
    Contributor

    I wrote a nixpkgs overlay for those that want to use the main branch today:

    https://github.com/iofq/nvim-treesitter-main

  10. mrcjkb commented on Dec 14, 2025

    @mrcjkb
    Member

    nvim-treesitter have now switched and made main their default branch.

    According to their support policy:

    The support policy for Neovim is

    1. the latest stable release;
    2. the latest nightly prerelease. > Other versions may work but are neither tested nor considered for fixes. In general, compatibility with Nvim 0.X is removed after the release of Nvim 0.(X+1).1.

    They haven't published a 1.0 release (and I don't think they will for a long time), but I would say now is the time for us to make the switch in nixpkgs.

  11. khaneliman commented on Dec 14, 2025

    @khaneliman
    Contributor

    I agree Marc, I was just posting about this in our nixvim chat because I came across it while testing #470251 and was gonna start working on migrating it.

    EDIT: Unless someone has worked through it already and has stuff PR ready.

  12. added
    6.topic: vim
    6.topic: tree-sitter
    on Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancement6.topic: tree-sitter6.topic: vim9.needs: package (update)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions