treesitter: attempt to adapt to (breaking) Nixpkgs changes#1315
treesitter: attempt to adapt to (breaking) Nixpkgs changes#1315NotAShelf merged 7 commits intoNotAShelf:mainfrom
Conversation
|
I compared |
817e902 to
1ea7688
Compare
1ea7688 to
d9a7393
Compare
|
I'm getting really sick of Nixpkgs at this point. "Yeah let's break everything without communication, the end-users can go fuck themselves! Oh my project? Yeah it's already updated." Eventually we should look into dropping Nixpkgs entirely for plugins and Treesitter grammars. Both of those have been managed terribly. Viper had a repository, but I imagine it's abandoned. If it isn't, we can look at a migration path soon. Anyway. My question about this PR is whether the updated grammar lines are all that broke. You seem to have changed a very small subset of languages, are those the ones you use or are those the ones you've confirmed to be broken? Might be worth giving the maximal configuration a try after enabling all language modules to test. |
|
Tested with my nvf config and it works like a charm! Thanks! |
Yeah, I feel you - the sad part is that I first assumed that something broke within Now for this PR - I naively thought that changing from But as I went back to a project I've been working on I noticed that the highlight wasn't showing up. Then I had the "brilliant" idea to check with That was completely empty - here's the output I have before the changes: I also noticed that when I apply the changes I tried updating this part of my nvf in my dotfiles > I tried using Copilot to help me figure this out as I'm not well-versed in nix at all 😞 and it said that something changed about the .so files location in the way the new packages are defined but I'm way out of my league here. Anyway, I think something is missing and I don't know how to debug/move forward. I also don't want to hold back the fix as you all know what you're doiwantng and I don't lol, definitely makes me properly learn --- adding a bit more The files for markdown and csharp the name of those packages seem to have changed so I had to adjust there. For python and sql I simply updated from using |
Are you actually getting highlights and whatnot? Did you change anything else? |
I just pointed the input to your branch and everything worked like before. At least as far as I can see. I can test stuff if you want. |
NotAShelf
left a comment
There was a problem hiding this comment.
I'm going to assume this is all, as I lack both the mental and the physical bandwidth to test all changes. Code looks fine, nothing out of the ordinary. For now I'm more concerned about getting the fix to the people, and then looking into ditching Nixpkgs' Neovim ecosystem as it is handled with the grace of a dead fish in a desert.
Before I merge though, this needs a changelog entry in the 0.9 changelog. Both as an user entry under your own name, and as a breaking change. See previous entries for how the breaking changes section operates.
|
@NotAShelf just updated it. |
|
I've got some documentation nitpicks, but I'm going to hold that back to avoid keeping the fix from the main branch any longer. Thank you for your effort, I'm going to fix the merge conflict and merge this. Docs update can come later. |
Fixed treesitter regression due to update in nixpkgs Refs: NotAShelf/nvf#1312 Refs: NotAShelf/nvf#1315
|
I just updated and it does not work for me. I don't get proper highlights
If I add However, even without installing a language manually or adding the |
|
One thing that doesn't work is the inline languages, for example this: environment.etc."stacks/home-assistant/config/configuration.yaml".text = # yaml
''
# Loads default set of integrations. Do not remove.
default_config:
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
'';That is not syntax highlighted anymore. |
Same, using the latest commit, the error disappears but I get no syntax highlighting anymore. |
TS CLI missing is not really an issue; we're managing grammars with Nix, so the correct way of installing them is using runtime paths and not the CLI. Adding it to packages and using The main issue, of course, is the non-communicated changes. According to the PR description, "nvim-treesitter now defaults to the main branch, which have many breaking changes, including not installing queries by default, so we need to install them, when specified." Do you know what "not installing queries by default" mean? Not installing the queries required for highlighting. A good additional change would be explaining this in the changelog itself or linking the relevant pull request, but no, all we get is "it's now incompatible, lol, use old if no work". Bravo. At this point I can't say I'm disappointed, but I am irritated. For now I'm also quite busy, but I'll be investigating what the fix is. The PR makes a very poor job at explaining how to migrate, so I'm going to have to do some "light" reading before I can submit a fix. Of course, my idea to stop relying on Nixpkgs for plugins AND Treesitter is developing at a somewhat decent pace, so it might also be the next step here. Either way I must defer to my co-maintainers @Soliprem and @horriblename to investigate in case they can respond faster than I can. |
|
This got merged an hour ago and seems to be the quickest way to fix this for now NixOS/nixpkgs#472119, in the long term someone will nee to go through the pain of figuring out how to migrate though, which I have to agree they've done a pretty poor job documenting. |
|
I think it would be a poor solution to go back at this point. I can tell why the change has happened, and I see the motive---but I condemn how it was handled in Nixpkgs. That said I think we have managed to mostly complete our side of migration. I will probably pin v0.8's nixpkgs to nixos stable and clarify that users may wish to stay on v0.8, as critical changes are planned to be backported. |
|
Hello everyone! I am really sorry for the headache after merging the master -> main update, I assumed someone from the neovim team would have merged nvim-treesitter-legacy afterwards, so that would make it easy to revert to the previous version. I opened a PR migrating nvim-treesitter in #1318, so it should be mostly fixed, besides missing some features previously available such as incremental selection, since I have merged nvim-treesitter-legacy, after it gets on unstable, someone could add support for it later on |
|
Thank you for your comment @HeitorAugustoLN. I appreciate you chiming in, and please understand that my somewhat aggressive comments are not directed to you specifically and generally to how the Neovim ecosystem is handled in Nixpkgs. Treesitter is not the first example, and you are of course not to blame for updating it. What I would've appreciated more is more details in the changelog (as this is a major change) on what the update entails, and how end-users should handle it. As a downstream consumer, I expect to be able to find relevant information in either the changelog or the manual. As it stands the manual doesn't cover builtGrammars and the such, and the changelog did not communicate the query changes. I happen to be outside of the loop, unlike Nixvim maintainers, and it is a little annoying that I've had to find the appropriate and read the diff to understand what needs to be done. That said, thank you for your PR. I have not been able to review it but I will once I'm on my system. I appreciate that you took the time to send a PR :) |
I know, it is really not the best as of now, don't worry about it.
I wanted to include something from upstream, but they don't have anything specific about it besides the README, which most people can find by searching for the plugin, so I did not include it in the changelog.
Well, See: NixOS/nixpkgs#470883 (comment)
No problem :) |
I am having the same problem, JSX elements arent highlighted and .svelte files are straight up not highlighted except for a few svelte-specific features.
@HeitorAugustoLN is there any solutions for this? |
|
You need to install some queries manually: {
vim.startPlugins = with pkgs.vimPlugins.nvim-treesitter.queries; [ ecma html_tags jsx ];
}I will try to fix this asap, by tracking the |
|
Perchun opened a PR for it NixOS/nixpkgs#478853 |
|
@rice-cracker-dev It is now fixed after: NixOS/nixpkgs#480516 |


Here's an attempt to fix the issues caused by NixOS/nixpkgs@71f1b82.
I tested with my dotfiles pointing to my fork and the error went away but I am not 100% sure things are working as expected so take this PR with a grain of salt 🤔
Fixes #1312
Sanity Checking
nix fmt).#nix(default package).#maximal.#docs-html(manual, must build).#docs-linkcheck(optional, please build if adding links)x86_64-linuxaarch64-linuxx86_64-darwinaarch64-darwinAdd a 👍 reaction to pull requests you find important.