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

[Bug]: Neovim default parsers are missing. #20617

Closed
ghost opened this issue Jun 21, 2024 · 7 comments · Fixed by #20635
Closed

[Bug]: Neovim default parsers are missing. #20617

ghost opened this issue Jun 21, 2024 · 7 comments · Fixed by #20635
Assignees
Labels
bug report Something is not working properly packaging Issue related to building packages, not affecting end users directly

Comments

@ghost
Copy link

ghost commented Jun 21, 2024

Problem description

Neovim wiki states it includes parsers for Vimdoc and Lua by default (source: https://neovim.io/doc/user/treesitter.html#treesitter-parsers).
Parsers are libraries that treesitter will search for in the parser runtime directory.
Currently,

/data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/help.lua
/data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/lua.lua
/data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/query.lua

are forcing treesitter over syntax, and since there are no parsers available for treesitter to be using it causes errors like these :

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35: Error executing lua: ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/help.lua: Vim(runtime):E5113: Error while calling lua chunk: ...s/usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'vimdoc' language, see :help treesitter-parsers
stack traceback:
        [C]: in function 'error'
        ...s/usr/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'
        ...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'new'
        ...rmux/files/usr/share/nvim/runtime/lua/vim/treesitter.lua:41: in function '_create_parser'
        ...rmux/files/usr/share/nvim/runtime/lua/vim/treesitter.lua:108: in function 'get_parser'
        ...rmux/files/usr/share/nvim/runtime/lua/vim/treesitter.lua:416: in function 'start'
        ...om.termux/files/usr/share/nvim/runtime/ftplugin/help.lua:2: in main chunk
        [C]: in function 'nvim_cmd'
        ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:36: in function <...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35: in function <...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:36: in function <...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35: in function <...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:35: in function <...ata/com.termux/files/usr/share/nvim/runtime/filetype.lua:10>
Press ENTER or type command to continue

this particular error shown above appears when opening Neovim help page inside Neovim by running Neovim command :h, similar errors appears when opening any lua file.

What steps will reproduce the bug?

  1. opening Neovim help page from inside of Neovim via :h or :help.
  2. opening any lua file.

What is the expected behavior?

No errors should appear when opening Neovim help page or opening any lua file.

System information

Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=18045
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.42.4
Android version:
10
Kernel build information:
Linux localhost 4.4.192-perf+ #1 SMP PREEMPT Fri Nov 5 12:30:40 CST 2021 aarch64 Android
Device manufacturer:
HMD Global
Device model:
Nokia 7.1
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@ghost ghost added bug report Something is not working properly untriaged labels Jun 21, 2024
@ghost ghost closed this as completed Jun 21, 2024
@ghost ghost reopened this Jun 21, 2024
@ghost
Copy link
Author

ghost commented Jun 21, 2024

please remove the lines of code which are forcing treesitter to be used in vimdoc and lua files.

or please provide required parsers in parser runtime directory like alpine linux doing here in the picture shown below:

Screenshot_20240621-091604~3

i have a freshly installed termux and after upgrading all packages i installed Neovim and i got the errors i mentioned when I opened it's help page.
it is a really bad thing that even opening neovim help page will throw errors and then if someone decides to configure neovim using lua then every single time a Lua file will be opened a huge error will appear on screen until a parser is installed manually in a neovim runtime path.

i don't use any plugins or treesitter in neovim but i often have to edit neovim configuration files in lua. only way i was able to fix it is by removing the lines of code that forced treesitter to be used in those particular files types, i failed to disable treesitter when i tried any other methods.

@ghost
Copy link
Author

ghost commented Jun 21, 2024

removing the line shown below from /data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/lua.lua fixed the errors for lua files, now no errors appear when i open any lua file.

vim.treesitter.start()

problem is if any update arrives and this isn't fixed, the changes i made will be reverted and errors will appear again so please remove these lines from package's source code itself.

@TomJo2000
Copy link
Member

TomJo2000 commented Jun 21, 2024

I'll try a full reinstall with an empty config later.

I probably missed this since I add a couple extra parsers as part of my config, so "smoke testing" 0.10 with it didn't throw up any parsers errors.

Edit: Okay the issue does replicate when using nvim --clean

@TomJo2000
Copy link
Member

TomJo2000 commented Jun 21, 2024

removing the line shown below from /data/data/com.termux/files/usr/share/nvim/runtime/ftplugin/lua.lua fixed the errors for lua files, now no errors appear when i open any lua file.

vim.treesitter.start()

problem is if any update arrives and this isn't fixed, the changes i made will be reverted and errors will appear again so please remove these lines from package's source code itself.

The problem isn't vim.treesitter.start(), we want neovim to use treesitter when available.
The issue is we didn't add the parsers into the package.
I'll have to do some local testing but that should be an easy fix.

Tip

If you are using the nvim-treesitter/nvim-treesitter plugin you can use
:TSInstall lua vimdoc
To install those two parsers.

@TomJo2000 TomJo2000 added packaging Issue related to building packages, not affecting end users directly and removed untriaged labels Jun 21, 2024
@TomJo2000 TomJo2000 self-assigned this Jun 21, 2024
@TomJo2000
Copy link
Member

closed by #20630

@Biswa96
Copy link
Member

Biswa96 commented Jun 22, 2024

Tom, I have created separate tree-sitter parser packages. May I create a pull request to add those. neovim also needs a fix for latest vimdoc parser.

@TomJo2000
Copy link
Member

Tom, I have created separate tree-sitter parser packages. May I create a pull request to add those. neovim also needs a fix for latest vimdoc parser.

Yep that probably makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly packaging Issue related to building packages, not affecting end users directly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants