-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Nixpkgs version
- Unstable (26.05)
Describe the bug
With the recent nvim-treesitter master->main update #470883 , we now have a nvim-treesitter-grammars package for parsers and queries for installed grammars. Based on
nixpkgs/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix
Lines 91 to 92 in 45a1530
| queryPlugins = lib.pipe selectedGrammars [ | |
| (map (g: g.passthru.associatedQuery or null)) |
nvim-treesitter-grammars package. There are special cases, like js/ts queries, which inherit the ecma query (https://github.com/nvim-treesitter/nvim-treesitter/blob/2ba5ec184609a96b513bf4c53a20512d64e27f39/runtime/queries/javascript/highlights.scm#L1). The ecma query is just a base query with no corresponding grammar.
This means the following package will miss the ecma query in nvim's runtime paths. The syntax highlighting will just fail silently.
pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [p.javascript])
For now, I am manually adding the ${nvim-treesitter}/runtime to rtp
{
plugin = my-treesitter;
config = ''vim.opt.rtp:prepend("${my-treesitter}/runtime/")'';
type = "lua";
}
in my home manager neovim config to workaround this problem.
Steps to reproduce
use pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [p.javascript]), open a javascript file, turn on treesitter highlight. There will be no syntax highlighting and no error message.
Expected behaviour
the ecma query should be included when javascript/typescript grammar is installed
Screenshots
No response
Relevant log output
Additional context
No response
System metadata
- system:
"aarch64-darwin" - host os:
Darwin 25.1.0, macOS 26.1 - multi-user?:
yes - sandbox:
no - version:
nix-env (Nix) 2.31.2+1 - channels(root):
"nixpkgs" - nixpkgs:
/nix/store/0yj36irhwn225ywy1saz0gf5wr2ciz50-source
Notify maintainers
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
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.