Skip to content

Migrate to nvim-treesitter 'main' - #3313

Merged
siduck merged 2 commits into
NvChad:v2.5from
ollien:v2.5
Jan 17, 2026
Merged

siduck merged 2 commits into
NvChad:v2.5from
ollien:v2.5

Conversation

@ollien

@ollien ollien commented Jul 12, 2025

Copy link
Copy Markdown
Contributor

This is my best stab at moving the nvim-treesitter integration to use the 'main' branch. I can personally say I haven't found any problems yet, but that doesn't mean there aren't any!

Grammars are still installed with the users' existing ensure_installed config entry. I thought about having this be something in chadrc, but that seems to be primarily used by the ui plugin, not by the main plugin, and this helps maintain some level of backwards compatibility.

I have a couple questions for you

  1. Is this an upgrade you're willing to pursue at this time?
  2. If so, how would you like to roll it out? Do you want to handle it similar to the blink transition? Do you want to make a breaking release to the library?

The big thing I wasn't able to cover in this transition is any migrations involving plugins that use nvim-treesitter; the new version doesn't manage them anymore (From the maintainer:

External plugins are not supported; they need to handle their own setup (as they should). Open an issue (but check first for existing issues or PRs!) at the plugin.

)

@ollien
ollien force-pushed the v2.5 branch 2 times, most recently from bfef671 to 224b888 Compare July 13, 2025 03:21
@siduck

siduck commented Jul 13, 2025

Copy link
Copy Markdown
Member
image ugh i hate all of this !!!

i will not use treesitter main until its the default branch

@ollien

ollien commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

ugh i hate all of this !!!

It's definitely less clean than it being handled for us, that's for sure. I'm happy to make any tweaks you'd like but I get the frustration with needing to do it at all.

i will not use treesitter main until its the default branch

Is this part of the release plan that has been laid out for nvim-treesitter? My understanding is it's already "released".

@siduck

siduck commented Jul 13, 2025

Copy link
Copy Markdown
Member

ugh i hate all of this !!!

It's definitely less clean than it being handled for us, that's for sure. I'm happy to make any tweaks you'd like but I get the frustration with needing to do it at all.

i will not use treesitter main until its the default branch

Is this part of the release plan that has been laid out for nvim-treesitter? My understanding is it's already "released".

i had talked with astrovim's dev and he told it'll take months for that plugin to keep main branch as default so we got a lot of time

@ollien

ollien commented Jul 13, 2025

Copy link
Copy Markdown
Contributor Author

i had talked with astrovim's dev and he told it'll take months for that plugin to keep main branch as default so we got a lot of time

Definitely. I mostly did this to see just how bad the migration would be, and wanted to contribute it back, but no hard feelings if you'd rather wait out a cleaner solution.

@siduck

siduck commented Aug 12, 2025 •

Copy link
Copy Markdown
Member

@siduck main is now backwards compatible

are you sure? i still see none of old syntax been used in its readme

@siduck

siduck commented Aug 16, 2025

Copy link
Copy Markdown
Member

@siduck main is now backwards compatible

are you sure? i still see none of old syntax been used in its readme

i tried using it and it seems to work completely fine

ensure_installed?

@ollien

ollien commented Aug 16, 2025

Copy link
Copy Markdown
Contributor Author

@Coding4Hours I don't think that's the case. The README still indicates a different method for installing LSPs

https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#setup

@siduck

siduck commented Dec 15, 2025

Copy link
Copy Markdown
Member

main is the default branch now, i'll move to it this weekend 🚀

@ollien

ollien commented Dec 15, 2025 •

Copy link
Copy Markdown
Contributor Author

@siduck Great! Would you prefer I rebase this PR or would you like to build your own approach? I know there were aspects of this PR you weren't happy about, given nvim-treesitters's limitations. Either works for me!

@siduck

siduck commented Dec 15, 2025

Copy link
Copy Markdown
Member

@siduck Great! Would you prefer I rebase this PR or would you like to build your own approach? I know there were aspects of this PR you weren't happy about, given nvim-treesitters's limitations. Either works for me!

dont worry, I'll let you know about my changes and we'll update your PR accordingly 😅

@ollien

ollien commented Dec 15, 2025 •

Copy link
Copy Markdown
Contributor Author

@siduck Great! Would you prefer I rebase this PR or would you like to build your own approach? I know there were aspects of this PR you weren't happy about, given nvim-treesitters's limitations. Either works for me!

dont worry, I'll let you know about my changes and we'll update your PR accordingly 😅

Cool. Looks like the rebase was reasonably straightforward, but I'm also happy to change whatever :)

@ollien

ollien commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

Hrmmm, I did find a small bug in this when trying to comment some lines

E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/filetype/options.lua:82: FileType Autocommands for "*": Vim(append):Error executing lua callback: /
usr/share/nvim/runtime/lua/vim/treesitter.lua:104: Buffer 6 must be loaded to create parser                                                                   
stack traceback:                                                                                                                                              
        [C]: in function 'error'                                                                                                                              
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:104: in function 'get_parser'                                                                          
        /home/nick/Documents/code/nvchad/lua/nvchad/autocmds.lua:32: in function </home/nick/Documents/code/nvchad/lua/nvchad/autocmds.lua:30>                
        [C]: in function 'nvim_get_option_value'                                                                                                              
        /usr/share/nvim/runtime/lua/vim/filetype/options.lua:82: in function 'get_option'                                                                     
        /usr/share/nvim/runtime/lua/vim/_comment.lua:50: in function 'traverse'                                                                               
        /usr/share/nvim/runtime/lua/vim/_comment.lua:60: in function 'get_commentstring'                                                                      
        /usr/share/nvim/runtime/lua/vim/_comment.lua:69: in function 'get_comment_parts'                                                                      
        /usr/share/nvim/runtime/lua/vim/_comment.lua:195: in function 'toggle_lines'                                                                          
        /usr/share/nvim/runtime/lua/vim/_comment.lua:240: in function </usr/share/nvim/runtime/lua/vim/_comment.lua:219>                                      
stack traceback:                                                                                                                                              
        [C]: in function 'nvim_get_option_value'                                                                                                              
        /usr/share/nvim/runtime/lua/vim/filetype/options.lua:82: in function 'get_option'                                                                     
        /usr/share/nvim/runtime/lua/vim/_comment.lua:50: in function 'traverse'                                                                               
        /usr/share/nvim/runtime/lua/vim/_comment.lua:60: in function 'get_commentstring'                                                                      
        /usr/share/nvim/runtime/lua/vim/_comment.lua:69: in function 'get_comment_parts'                                                                      
        /usr/share/nvim/runtime/lua/vim/_comment.lua:195: in function 'toggle_lines'                                                                          
        /usr/share/nvim/runtime/lua/vim/_comment.lua:240: in function </usr/share/nvim/runtime/lua/vim/_comment.lua:219>   

Will see if I can figure this out sometime this week

@siduck

siduck commented Dec 21, 2025 •

Copy link
Copy Markdown
Member

i'll make my changes now. use the dev branch and see

d937529

@ollien @Coding4Hours

@ollien

ollien commented Dec 21, 2025 •

Copy link
Copy Markdown
Contributor Author

@siduck TSInstallAll fails with the following

Error executing Lua callback: ...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:40: attempt to call field 'install' (a nil value)          
stack traceback:                                                                                                                                               
        ...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:40: in function <...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:38>  

Running :lua =require("nvim-treesitter") gives me this

{                                                                                                                                                    
  define_modules = <function 1>,                                                                                                                               
  setup = <function 2>,                                                                                                                                        
  statusline = <function 3>                                                                                                                                    
}  

EDIT, ah this may be on me, for some reason nvim-treesitter didn't actually change to the new branch?

@siduck

siduck commented Dec 22, 2025 •

Copy link
Copy Markdown
Member

@siduck TSInstallAll fails with the following

Error executing Lua callback: ...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:40: attempt to call field 'install' (a nil value)          
stack traceback:                                                                                                                                               
        ...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:40: in function <...ck/.local/share/nvim/lazy/NvChad/lua/nvchad/autocmds.lua:38>  

Running :lua =require("nvim-treesitter") gives me this

{                                                                                                                                                    
  define_modules = <function 1>,                                                                                                                               
  setup = <function 2>,                                                                                                                                        
  statusline = <function 3>                                                                                                                                    
}  

EDIT, ah this may be on me, for some reason nvim-treesitter didn't actually change to the new branch?

remove treesitter by pressing "x" in your Lazy window and remove your lazylock file

@siduck

siduck commented Dec 22, 2025

Copy link
Copy Markdown
Member

also do join my discord/telegram/matrix server if you have any of those accounts! discussing their feels easier 😁 @ollien

@elsesiy

elsesiy commented Jan 16, 2026

Copy link
Copy Markdown

@siduck Is there any update here? When can we expect this to merge? 🙇

@siduck

siduck commented Jan 17, 2026

Copy link
Copy Markdown
Member

@siduck Is there any update here? When can we expect this to merge? 🙇

My apologies for delaying a lot! By Today 🥺

@siduck
siduck merged commit 6a0715d into NvChad:v2.5 Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants