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

Rocks install neorg: setup() errors on nvim-treesitter.ts_utils #1351

Open
2 tasks done
willcoxe opened this issue Mar 26, 2024 · 3 comments
Open
2 tasks done

Rocks install neorg: setup() errors on nvim-treesitter.ts_utils #1351

willcoxe opened this issue Mar 26, 2024 · 3 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@willcoxe
Copy link

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0-dev-2698+g00e71d3da3

Neorg setup

require("neorg").setup()

Actual behavior

Neorg not loading at all. Error message:

Error detected while processing /home/myuser/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/rocks.nvim/2.19.1-1/plugin/rocks.lua:
E5113: Error while calling lua chunk: ...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: ...ua/neorg/modules/core/integrations/treesitter/module.lua:53: Unable to load nvim-treesitter.ts_utils :(
stack traceback:
        [C]: in function 'error'
        ...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: in function 'setup'
        ...rocks/rocks_rtp/lua/rocks-config/rocks/hooks/preload.lua:20: in function 'hook'
        ...local/share/nvim/rocks/rocks_rtp/lua/rocks/api/hooks.lua:63: in function 'run_preload_hooks'
        .../luarocks/rocks-5.1/rocks.nvim/2.19.1-1/plugin/rocks.lua:31: in main chunk

Expected behavior

No error & being able to start using :Neorg

Steps to reproduce

  1. install nvim
  2. follow instructions for setting up rocks from https://github.com/nvim-neorocks/rocks.nvim (e.g. run: nvim -u NORC -c "source https://raw.githubusercontent.com/nvim-neorocks/rocks.nvim/master/installer.lua")
  3. exec Rocks install rocks-config.nvim
  4. exec Rocks install neorg
  5. echo "require("neorg").setup()" >> .config/nvim/lua/plugins/neorg.lua

Potentially conflicting plugins

No other plugins, installed everything fresh, followed instructions

Other information

Also tried with other versions of nvim (installed via archlinux > nvim, nvim-git and/or nvim-nightly)

Help

None

Implementation help

No response

@willcoxe willcoxe added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Mar 26, 2024
@NTBBloodbath
Copy link
Member

Hey, one of the rocks.nvim developers here :)

Currently the nvim-treesitter plugin in Luarocks has some problems that I will describe below, so if you don't want to read all that, I will tell you the direct solution before the explanation :p

It will be best if you use rocks-git.nvim (which is a rocks.nvim extension to also install plugins through Git) to install nvim-treesitter currently.


But why?

nvim-treesitter versioning is not semantic, and is really strange, which makes it unreliable.

The original nvim-treesitter package (neovim/nvim-treesitter) follows this version, which is not bad, but it has some trade-offs. off:

  • In the latest version available there is a bug with the parser installation directory since luarocks does not follow the directory hierarchy that nvim-treesitter normally expects to have.
  • Since plugin releases are not updated very frequently, some parsers can break because the tree-sitter queries are handled directly by nvim-treesitter, so they can become obsolete if there is a change that breaks in some parser (e.g. the javascript parser is completely broken when you enter a .js file)

Now, if that version works, why the errors? This is because the nvim-neorocks team behind rocks.nvim maintains a repository of user rocks (NURR) which has priority on the hosts that use rocks.nvim to get rocks and the version of nvim-treesitter that is in that repository is the main branch (needs Neovim nightly!), in which the nvim-treesitter team is constantly rewriting the plugin and removing things that already exist in the vim.treesitter API, and one of those things is used by neorg, which which causes neorg to break due to its absence :(

@willcoxe
Copy link
Author

willcoxe commented Mar 27, 2024

Perfect. Thanks for the extensive explanation that was really helpful.

I now have installed treesitter via rocks-git.nvim & it is included in the rocks.toml like:

[plugins.nvim-treesitter]
git = "nvim-treesitter/nvim-treesitter"
rev = "v0.9.2^{}"

and it works now!

Small notes just for interest

  1. running :Neorg sync-parsers echos some nvim-treesitter things but nothing breaks as a result (apparently)
  2. I use :TSInstall for all the parsers now rather than rocks & this doesn't seem to create any issues at all

@CRAG666
Copy link

CRAG666 commented Apr 13, 2024

Same error, i have rocks-tresitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

3 participants