You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated the plugin to the latest version before submitting this issue
I have searched the existing issues of lazy.nvim
I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.12.1
Operating system/version
MacOS 25.4.1
Describe the bug
During initial bootstrap of the configs, lazy seems to remove the vim.fn.stdpath("data") .. "/site" directory from the runtimepath, even though it gets set explicitly. Given that the /site subdirectory might not exist during the bootstrap phase, it will get populated when nvim-treesitter plugin gets loaded and downloads parsers.
This causes cascading issues since, at that time, neovim is unaware of the newly installed parsers, due to being missing from rtp, and fails to start treesitter when a matching filetype is opened because parsers aren't located.
Note
This all happens within the initial/first session of neovim. This gets fixed once one closes and re-opens a new session, since the /site directory is now populated.
Code
It seems that the following line is the one that's corrupting the rtp (due to the implementation omitting empty directories):
echo '# vim: filetype=bash' > test.sh (This will allow the filetype to be properly set to bash)
nvim -u repro.lua test.sh
Should see a classic treesitter error to appear:
Error in BufReadPost Autocommands for "*":
Lua callback: ...-neovim-unwrapped-0.12.1/share/nvim/runtime/filetype.lua:28: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Lua callback: ...wrapped-0.12.1/share/nvim/runtime/lua/vim/treesitter.lua:449: Parser could not be created
for buffer 1 and language "bash"
stack traceback:
...
Expected Behavior
The new treesitter parser directory at vim.fn.stdpath("data") .. "/site" gets added here, if options.performance.rtp.reset option is true. And should persist after plugins are loaded and configured, so that treesitter can start highlights, etc. (without having to reopen a new session).
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.12.1
Operating system/version
MacOS 25.4.1
Describe the bug
During initial bootstrap of the configs, lazy seems to remove the
vim.fn.stdpath("data") .. "/site"directory from theruntimepath, even though it gets set explicitly. Given that the/sitesubdirectory might not exist during the bootstrap phase, it will get populated whennvim-treesitterplugin gets loaded and downloads parsers.This causes cascading issues since, at that time, neovim is unaware of the newly installed parsers, due to being missing from
rtp, and fails to starttreesitterwhen a matching filetype is opened because parsers aren't located.Note
This all happens within the initial/first session of neovim. This gets fixed once one closes and re-opens a new session, since the
/sitedirectory is now populated.Code
It seems that the following line is the one that's corrupting the
rtp(due to the implementation omitting empty directories):RTP after Error
Steps To Reproduce
Example with
bashparser:echo '# vim: filetype=bash' > test.sh(This will allow the filetype to be properly set tobash)nvim -u repro.lua test.shtreesittererror to appear:Expected Behavior
The new treesitter parser directory at
vim.fn.stdpath("data") .. "/site"gets added here, ifoptions.performance.rtp.resetoption istrue. And should persist after plugins are loaded and configured, so thattreesittercan start highlights, etc. (without having to reopen a new session).Repro