Skip to content

use main branch for treesitter to remove depracted vim.validate api #1579

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

Closed

Conversation

johnpekcan
Copy link
Contributor

Recently noticed api deprecated warning while checking :checkhealth and opened a ticket with treesitter:
nvim-treesitter/nvim-treesitter#7916

Upon reading further, I found out that they have deprecated the master branch and are using main -- which removed the deprecated api. I'm updating kickstart to reflect their recommended install settings:
https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#installation

@johnpekcan
Copy link
Contributor Author

johnpekcan commented May 31, 2025

Still see the error for nvim-tree, but they have a fix waiting for release: nvim-tree/nvim-tree.lua#3120

vim.deprecated:                                                           1 ⚠️

 ~
- ⚠️ WARNING vim.validate is deprecated. Feature will be removed in Nvim 1.0
  - ADVICE:
    - use vim.validate(name, value, validator, optional_or_msg) instead.
    - stack traceback:
        [C]:-1
        /Users/john.pekcan/.local/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/utils.lua:352
        /Users/john.pekcan/.local/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/legacy.lua:9
        /Users/john.pekcan/.local/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/legacy.lua:91
        /Users/john.pekcan/.local/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree.lua:712
        /Users/john.pekcan/.config/nvim/lua/custom/plugins/init.lua:14
        /Users/john.pekcan/.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:380
        [C]:-1

build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also been looking into this and I think the main branch, doesn't support those options at the time. Or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. seeing some unexpected behavior in treesitter now. My helm template files are actually rendering correctly as yaml now -- but setting filetype :set filetype=helm seems to break the syntax highlight again. :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe main branch isn't ready for prime time shrug

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {
	"nvim-treesitter/nvim-treesitter",
	build = ":TSUpdate",
	branch = "main",
	config = function()
		require("nvim-treesitter").install({
			"c",
			"lua",
			"vim",
			"vimdoc",
			"query",
			"elixir",
			"heex",
			"javascript",
			"html",
			"rust",
			"dart",
		})
	end,
}

This is the closest I got to replicating the old behavior, but the other options are missing tho. Maybe this helps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! that certainly got us closer. but definitely different behavior still.

Copy link

@1Naim 1Naim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned by clason in your linked issue, the main branch is not a drop-in replacement, therefore the existing config will not work. You will have to rewrite it if you want to get this merged.

@johnpekcan johnpekcan closed this May 31, 2025
@johnpekcan johnpekcan deleted the treesitter-use-main-branch branch May 31, 2025 21:35
@johnpekcan
Copy link
Contributor Author

Totally valid! I totally glossed over that 😅 Cheers!

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