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(+)