Skip to content

bug: Treesitter error #661

@Muizzyranking

Description

@Muizzyranking

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.12.0-dev-1074+g58060c2340

Operating system/version

Windows wsl 2

Describe the bug

When I open trouble diagnostics or sending snacks selection to trouble, i get this error.

                     vim.schedule callback: ...e/nvim/lazy/trouble.nvim/lua/trouble/view/treesitter.lua:34: invalid key: on_range
stack traceback:
	[C]: in function 'nvim_set_decoration_provider'
	...e/nvim/lazy/trouble.nvim/lua/trouble/view/treesitter.lua:34: in function 'setup'
	...e/nvim/lazy/trouble.nvim/lua/trouble/view/treesitter.lua:56: in function 'attach'
	...l/share/nvim/lazy/trouble.nvim/lua/trouble/view/text.lua:187: in function <...l/share/nvim/lazy/trouble.nvim/lua/trouble/view/text.lua:180>

I noticed this happened after I switched from treesitter master to main

Steps To Reproduce

Reproducing requires setting up lsp or a picker, so using LazyVim without customisation does the trick

  1. Create a file named repro.lua
  2. Paste this into the file
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
   spec = {
   	{
   		"LazyVim/LazyVim",
   		import = "lazyvim.plugins",
   		opts = { colorscheme = "catppuccin" },
   	},
   },
})
  1. Run with
nvim -u repro.lua
  1. After installation is complete, open the file picker (snacks by default) with <leader>ff
  2. Select some files with <Tab>
  3. Send the files to trouble with <Alt-T>

Expected Behavior

It is suppose to open trouble without errors.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
	spec = {
		{
			"LazyVim/LazyVim",
			import = "lazyvim.plugins",
			opts = { colorscheme = "catppuccin" },
		},
	},
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions