-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
vimPlugins.nvim-treesitter-legacy: init #472119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
HeitorAugustoLN
merged 2 commits into
NixOS:master
from
PerchunPak:nvim-treesitter-legacy
Jan 6, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...applications/editors/vim/plugins/non-generated/nvim-treesitter-legacy-parsers/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| lib, | ||
| vimPlugins, | ||
| }: | ||
| lib.recurseIntoAttrs vimPlugins.nvim-treesitter-legacy.grammarPlugins |
13 changes: 13 additions & 0 deletions
13
pkgs/applications/editors/vim/plugins/non-generated/nvim-treesitter-legacy/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { vimUtils, fetchFromGitHub }: | ||
| vimUtils.buildVimPlugin { | ||
| 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 = [ ]; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
mainqueries.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.
There was a problem hiding this comment.
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 releaseThere was a problem hiding this comment.
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?
You mean the
mainparsers 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the queries?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.