It seems upstream neovim 0.10+ is building and installing treesitter parsers for lua and vimdoc (among others), as a part of neovim. However the gentoo ebuild does not build or install these parsers. I think this is because the build step for these parsers is separate from that of neovim, requiring separate cmake & ninja steps in the .deps directory. (BTW the neovim source directory includes a top-level Makefile that calls cmake and ninja appropriately for both the .deps and the main neovim build, so following upstream's build instructions works just fine.) Because treesitter parsers are not installed, the lua filetype plugin attempts to load them, even with an empty RC file $ nvim -u NORC a.lua Error detected while processing BufNewFile Autocommands for "*": Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/share/nvim/runtime/filetype.lua:36: BufNewFile Autocommands for "*"..FileType Autocommands for "*"..functio n <SNR>1_LoadFTPlugin[20]..script /usr/share/nvim/runtime/ftplugin/lua.lua: Vim(runtime):E5113: Error while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'l ua' language, see :help treesitter-parsers Similarly :help throws errors attempting to load vimdoc treesitter parsers: $ nvim -u NORC :help Error detected while processing BufReadPost Autocommands for "*": Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/shar e/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..func tion <SNR>1_LoadFTPlugin[20]..script /usr/share/nvim/runtime/ftplugin/help.lua: Vim(runtime):E5113: E rror while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'vimdoc' language, see :help treesitter-parsers
Okay, I've digged into this a bit. There are these CMake flags[0] that installs the tree sitter grammar, USE_BUNDLED_TS_PARSERS to be specific. So basically in upstream they have USE_BUNDLED set to ON and hence neovim installs the required .so files while doing "make install". To reproduce this bug with upstream you can just do > make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF which will not install the treesitter grammars. We already have a PR[1] adding the required grammar's to ::gentoo but it's taking some work. I checked how other distributions install neovim, and most of them have separate grammars and -DUSE_BUNDLED=OFF. So we have to wait for the PR[1] being merged. I've added Vadim (author of the PR) in the CC list for better visibility. [0]: https://github.com/neovim/neovim/blob/b6c1ce8a9545575f8b1ea75e29a4ee9f018e3276/contrib/local.mk.example#L44 [1]: https://github.com/gentoo/gentoo/pull/35461
Or we can do it like Void linux > cmake -S cmake.deps -B .deps -G Ninja -DUSE_BUNDLED=OFF -DUSE_BUNDLED_TS_PARSERS=ON That will install the required grammars that are needed by default.
I tried playing around with -DUSE_BUNDLED=ON and -DUSE_BUNDLED_TS_PARSERS=ON by adding them to the mycmakeargs of the 0.10.0 ebuild, but got " One or more CMake variables were not used by the project", maybe I'm doing something wrong
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55731833cf4323b969e5d43af3bf67d2724d5241 commit 55731833cf4323b969e5d43af3bf67d2724d5241 Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-10 08:07:11 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:53:19 +0000 dev-libs/tree-sitter-query: new package, add 0.4.0 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-query/Manifest | 1 + dev-libs/tree-sitter-query/metadata.xml | 23 ++++++++++++++++++++++ .../tree-sitter-query-0.4.0.ebuild | 16 +++++++++++++++ 3 files changed, 40 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ab7692f8fc59be6260d493296763a437d3d0e3d commit 9ab7692f8fc59be6260d493296763a437d3d0e3d Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-10 08:05:20 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:53:18 +0000 dev-libs/tree-sitter-vimdoc: new package, add 3.0.0 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-vimdoc/Manifest | 1 + dev-libs/tree-sitter-vimdoc/metadata.xml | 23 ++++++++++++++++++++++ .../tree-sitter-vimdoc-3.0.0.ebuild | 16 +++++++++++++++ 3 files changed, 40 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c4d054a9042e4befc8fda41142045a0527b57c commit 75c4d054a9042e4befc8fda41142045a0527b57c Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-10 08:02:01 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:53:18 +0000 dev-libs/tree-sitter-vim: new package, add 0.4.0 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-vim/Manifest | 1 + dev-libs/tree-sitter-vim/metadata.xml | 23 ++++++++++++++++++++++ .../tree-sitter-vim/tree-sitter-vim-0.4.0.ebuild | 16 +++++++++++++++ 3 files changed, 40 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bb981c09c2752290d66fc0fd898abcfb1e674a8 commit 7bb981c09c2752290d66fc0fd898abcfb1e674a8 Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-10 11:32:32 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:53:18 +0000 dev-libs/tree-sitter-markdown-inline: new package, add 0.2.3 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-markdown-inline/Manifest | 1 + dev-libs/tree-sitter-markdown-inline/metadata.xml | 23 ++++++++++++++++++++ .../tree-sitter-markdown-inline-0.2.3.ebuild | 25 ++++++++++++++++++++++ 3 files changed, 49 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed5b89e81ababa6e32112c55187c6244014cdebf commit ed5b89e81ababa6e32112c55187c6244014cdebf Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-10 07:57:23 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:53:18 +0000 dev-libs/tree-sitter-markdown: new package, add 0.2.3 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-markdown/Manifest | 1 + dev-libs/tree-sitter-markdown/metadata.xml | 23 ++++++++++++++++++++++ .../tree-sitter-markdown-0.2.3.ebuild | 17 ++++++++++++++++ 3 files changed, 41 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b083d6b4b3427940f408b03ed37fd76909e1fce3 commit b083d6b4b3427940f408b03ed37fd76909e1fce3 Author: Brahmajit Das <brahmajit.xyz@gmail.com> AuthorDate: 2024-06-09 22:00:04 +0000 Commit: Matthew Smith <matthew@gentoo.org> CommitDate: 2024-06-11 16:52:09 +0000 dev-libs/tree-sitter-lua: new package, add 0.1.0 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matthew Smith <matthew@gentoo.org> dev-libs/tree-sitter-lua/Manifest | 1 + dev-libs/tree-sitter-lua/metadata.xml | 23 ++++++++++++++++++++++ .../tree-sitter-lua/tree-sitter-lua-0.1.0.ebuild | 16 +++++++++++++++ 3 files changed, 40 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbe4bc7b9dc970271127a5f167c95da78e32e282 commit fbe4bc7b9dc970271127a5f167c95da78e32e282 Author: Vadim Misbakh-Soloviov <mva@gentoo.org> AuthorDate: 2024-02-21 17:59:50 +0000 Commit: Arthur Zamarin <arthurzam@gentoo.org> CommitDate: 2024-07-05 10:55:37 +0000 tree-sitter-grammar.eclass: extended packaging 1) put grammar library to additional well-known path 2) also put queries See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dlua&arch=x86_64&repo=community See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dcss&arch=x86_64&repo=community Refer: https://github.com/gentoo/gentoo/pull/35475 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Vadim Misbakh-Soloviov <mva@gentoo.org> Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/37122 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> eclass/tree-sitter-grammar.eclass | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Hmmm, I re-emerged neovim and treesitter, and it's still broken :( [ebuild R ] dev-libs/tree-sitter-0.22.6:0/0.22.6::gentoo 0 KiB [ebuild R ~] app-editors/neovim-0.10.0::gentoo USE="nvimpager -test" LUA_SINGLE_TARGET="luajit -lua5-1" 0 KiB
Same here after updating the system. Running neovim with default settings raise this errors when opening lua files or vimdocs: Vim(runtime):E5113: Error while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'lua' language Vim(runtime):E5113: Error while calling lua chunk: /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'vimdoc' language I'm replying because the bug status says RESOLVED FIXED
Re-opening. The neovim ebuild has not been committed to master yet. I see a PR for it, but it is failing QA checks. Not sure what needs to be done about it.
https://github.com/gentoo/gentoo/pull/37178
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0ab3c616987b055cf0240fb09aab33e2ee49ba7 commit c0ab3c616987b055cf0240fb09aab33e2ee49ba7 Author: Violet Purcell <vimproved@inventati.org> AuthorDate: 2024-06-15 20:54:21 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2024-07-27 05:46:47 +0000 app-editors/neovim: depend on and symlink required treesitter parsers In 0.10.0, neovim made a small subset of tree-sitter parsers (bash, c, lua, python, query, vim, vimdoc) required and load automatically upon opening their respective filetypes. However, this change was missed and was not properly reflected in the 0.10.0 bump, leading to errors upon opening any file of those filetypes (includig running :help). Those parsers have now been added to tree, so this commit adds the correct dependencies and symlinks the parsers to their correct locations in /usr/share/nvim/runtime/parser. Closes: https://bugs.gentoo.org/933833 Signed-off-by: Violet Purcell <vimproved@inventati.org> Closes: https://github.com/gentoo/gentoo/pull/37178 Signed-off-by: Joonas Niilola <juippis@gentoo.org> app-editors/neovim/neovim-0.10.0-r1.ebuild | 129 +++++++++++++++++++++++++++++ app-editors/neovim/neovim-9999.ebuild | 15 ++++ 2 files changed, 144 insertions(+)