Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
lib,
vimPlugins,
}:
lib.recurseIntoAttrs vimPlugins.nvim-treesitter-legacy.grammarPlugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPlugin {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: nvim-treesitter-legacy has lots of queries in its runtimepath.
They will conflict with the nvim-treesitter main queries.

As the current most common use case is for people to pull in nvim-treesitter-legacy as a dependency of another plugin, this can break things in subtle ways that may be difficult to troubleshoot.

We should probably remove the queries from nvim-treesitter-legacy and make them opt-in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a check if two different versions of nvim-treesitter are installed
31d10c1

Also, even if someone tries to install a plugin with a parser from nvim-treesitter main, but has nvim-treesitter.withAllPlugins, the parsers should still be compatible, as we used the list of those from main branch long before release

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The queries and parsers are now decoupled. What if someone wants to install the parsers and queries without nvim-treesitter?

the parsers should still be compatible, as we used the list of those from main branch long before release

You mean the main parsers should still be compatible with the nvim-treesitter-legacy queries?
That's not going to be guaranteed for future updates. The nvim-treesitter-legacy queries are frozen, the parsers aren't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I can remove old parsers and only use the new ones, which should solve compatibility issues. But this minor use case should not block this PR. Currently, most of the plugins that use nvim-treesitter are broken. I can create a follow-up PR, but I do not want to change this, so no one has to re-review it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the queries?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking if the user has duplicated queries from the main and master branches is impossible because we symlinkJoin those. So the only solution would be to get rid of both old queries and parsers

Deleting one of those doesn't really make sense because, as you said

That's not going to be guaranteed for future updates. The nvim-treesitter-legacy queries are frozen, the parsers aren't.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the only solution would be to get rid of both old queries and parsers

That's what I'm proposing (and yes, it's fine if we do this in a follow-up PR).

The only reason configs are breaking is because plugins rely on the old module API, which is Lua and should have no compatibility issues with the new queries or parsers (unless, the capture names for indents, etc. change, which I think is unlikely to happen anytime soon).

Long term, we should aim to fix upstream plugins that depend on nvim-treesitter-legacy to depend on treesitter-modules.nvim instead.

pname = "nvim-treesitter-legacy";
version = "0.10.0-unstable-2025-05-24";
src = fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "42fc28ba918343ebfd5565147a42a26580579482";
hash = "sha256-CVs9FTdg3oKtRjz2YqwkMr0W5qYLGfVyxyhE3qnGYbI=";
};
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter/";
meta.hydraPlatforms = [ ];
}
Loading
Loading