Skip to content
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

Revert "vimPlugins.nvim-treesitter: collate grammars" #341079

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

PerchunPak
Copy link
Member

@PerchunPak PerchunPak commented Sep 10, 2024

Description of changes

This reverts PR #319233. It caused a lot of weird regressions and a lot of headaches for me. Even a 20% improvement isn't worth it. Also see #319233 (comment)

In addition, I added a workaround for #332580 as it is also a very annoying regression that will reappear after merging this (minimal reproduction example: #332580 (comment))

Fixes #341442

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

CC @figsoda, @BirdeeHub
@MangoIV, could you try this with koka? Treesitter didn't detect its grammar for some reason for me


Add a 👍 reaction to pull requests you find important.

This reverts PR NixOS#319233. It caused a lot of weird regressions and a lot
of headaches for me. Even a 20% improvement isn't worth it.

Also see NixOS#319233 (comment)
A NixOS#319233 accidentally reverted NixOS#321550. Last one caused a very annoying
regression to any Nix user (see NixOS#332580). I suppose this is a bug in
upstream grammar, so I workaround it this way until it is properly
resolved.
@PerchunPak
Copy link
Member Author

Result of nixpkgs-review pr 341079 run on x86_64-linux 1

2 packages built:
  • vimPlugins.nvim-treesitter-parsers.nix
  • vimPluginsUpdater

Result of nixpkgs-review pr 341079 run on (emulated) aarch64-linux 1

2 packages built:
  • vimPlugins.nvim-treesitter-parsers.nix
  • vimPluginsUpdater

@BirdeeHub
Copy link
Contributor

BirdeeHub commented Sep 11, 2024

This is a straight up revert, yes? Im ok with that. It does cause weird things when multiple things add grammars because now you have 2 bundled grammar balls with the same name instead of just 1

The workaround added is ok I think? You likely know more about if thats a good solution or not than I do right now. Id like to see a fix get pushed to the nix grammar eventually for that.

@BirdeeHub
Copy link
Contributor

Result of nixpkgs-review pr 341079 run on x86_64-linux 1

2 packages built:
  • vimPlugins.nvim-treesitter-parsers.nix
  • vimPluginsUpdater

@stephen-huan
Copy link
Member

Apologies again and thanks for handling this @PerchunPak!

For posterity, what do #332580 and #321550 have to do with #319233?

@PerchunPak
Copy link
Member Author

For posterity, what do #332580 and #321550 have to do with #319233?

#319233 accidentally reverted #321550 and #321550 introduced a very annoying regression described in #332580. On every key press in nix file, there was an error emitted

@PerchunPak
Copy link
Member Author

This is a straight up revert, yes?

Yes, it is

It does cause weird things when multiple things add grammars because now you have 2 bundled grammar balls with the same name instead of just 1

Treesitter should prefer the first grammar it finds, as stated in :help treesitter, and looks like this behavior was fine for everyone

Parsers are searched for as parser/{lang}.* in any 'runtimepath' directory.
If multiple parsers for the same language are found, the first one is used.
(NOTE: This typically implies the priority "user config > plugins > bundled".)


Id like to see a fix get pushed to the nix grammar eventually for that.

That's for upstream to work on, I don't know anything about writing queries for treesitter
nix-community/tree-sitter-nix#84

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 12, 2024
@BirdeeHub
Copy link
Contributor

LGTM then!

@PerchunPak PerchunPak added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Sep 13, 2024
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: vim 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nvim-treesitter not linking grammars
5 participants