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

Error with treesitter plugin #39

Closed
gador opened this issue Sep 8, 2022 · 5 comments
Closed

Error with treesitter plugin #39

gador opened this issue Sep 8, 2022 · 5 comments

Comments

@gador
Copy link
Contributor

gador commented Sep 8, 2022

Hi,
I'm getting the following error:

Line   65:
Parser dir ' /nix/store/vhlasav5vp7c83ck32gq6csf205i06gg-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter/parser ' should be read/write (see README on how to configure an alternative install location) /nix/store/vhlasav5vp7c83ck32gq6csf205i06gg-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter/parser '

My config is the following:

programs.nixvim = {
        enable = true;
        colorschemes.base16 = {
          enable = true;
          colorscheme = "gruvbox-dark-medium";
        };
        plugins.gitgutter = {
          enable = true;
        };
        plugins.lsp = {
          enable = true;
          servers.rnix-lsp.enable = true;
          servers.pyright.enable = true;
        };

        plugins.nix.enable = true;
        plugins.airline.enable = true;
        plugins.airline.powerline = true;
        plugins.treesitter.enable = true;
        plugins.nvim-autopairs.enable = true;
        plugins.undotree.enable = true;
        plugins.startify = {
          enable = true;
          useUnicode = true;
        };
        plugins.treesitter.ensureInstalled = [
          "bash"
          "cpp"
          "css"
          "go"
          "html"
          "java"
          "json"
          "latex"
          "lua"
          "make"
          "nix"
          "python"
          "regex"
          "rust"
          "yaml"
        ];
        options = {
          number = true; # Show line numbers
          shiftwidth = 2; # Tab width should be 2
          mouse = "a";
          tabstop = 2;
          expandtab = true;
          smarttab = true;
          autoindent = true;
          cindent = true;
          linebreak = true;
          hidden = true;
        };
        extraPlugins = with pkgs.vimPlugins; [
          vim-autoformat
        ];
        maps = {
          normal."<F3>" = ":Autoformat<CR>";
        };
      };

This happens on 88fb867 (current master)

@pta2002
Copy link
Collaborator

pta2002 commented Sep 8, 2022

Could you try manually setting plugins.treesitter.nixGrammars to both true and false? One of them might work.

Don't get me wrong, this is 100% a bug and I'm trying to figure it out, but I think I've had success with that workaround and manually doing :TSUninstall all followed by :TSInstall all

@gador
Copy link
Contributor Author

gador commented Sep 8, 2022

Hi @pta2002 thanks for the promt answer!
Unfortunately neither option helped. It always results in the same error message about treesitter not being able to read/write.
Only disabling treesitter completely got rid of the error message..

@pta2002
Copy link
Collaborator

pta2002 commented Sep 11, 2022

This seems to be triggered by a change in treesitter. Upstream issue is here: NixOS/nixpkgs#189838. For now, I'll see if I can implement the suggested workaround, but this seems like an upstream problem unfortunately

@gador
Copy link
Contributor Author

gador commented Sep 12, 2022

ah, yes, I see. Thanks for investigating further!

@pta2002
Copy link
Collaborator

pta2002 commented Sep 12, 2022

Temporarily fixed by implementing the suggested workaround if nixGrammars = true. This bypasses nvim-treesitter's parser management and installs all of the parsers directly from nix. Should fix a few issues regarding mismatched libc versions, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants