telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

Treesitter highlighting doesn't work with the new version of treesitter

Open khushmmehta opened this issue 7 months ago • 8 comments

Description

Image

Neovim version

NVIM v0.11.1
Build type: RelWithDebInfo
LuaJIT 2.1.1741730670

Operating system and version

Linux 6.14.7-arch2-1

Telescope version / branch / rev

telescope 0.1.8

checkhealth telescope

Checking for required plugins ~
- ✅ OK plenary installed.
- ✅ OK nvim-treesitter installed.

Checking external dependencies ~
- ✅ OK rg: found ripgrep 14.1.1
- ✅ OK fd: found fd 10.2.0

===== Installed extensions =====

Steps to reproduce

open neovim :Telescope find_files

Expected behavior

Telescope should work with treesitter highlighting.

Actual behavior

Treesitter highlighting is broken after the new treesitter version on the main branch

Minimal config

(I don't know how to properly set this up, please excuse me)

-- telescope.lua
return {
  'nvim-telescope/telescope.nvim', tag = '0.1.8',
 dependencies = { 'nvim-lua/plenary.nvim' },
}

--treesitter.lua
return {
  'nvim-treesitter/nvim-treesitter',
  lazy = false,
  branch = 'main',
  build = ':TSUpdate',
  config = function()
    require'nvim-treesitter'.setup {
      -- Directory to install parsers and queries to
      install_dir = vim.fn.stdpath('data') .. '/site'
    }
    require'nvim-treesitter'.install{ 'lua', 'html', 'css', 'javascript', 'typescript', 'svelte', 'rust' }

    vim.api.nvim_create_autocmd('FileType', {
      pattern = { '<filetype>' },
      callback = function() vim.treesitter.start() end,
    })
    vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
    vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
  end
}

khushmmehta avatar May 28 '25 12:05 khushmmehta

+1

0xDmtri avatar May 28 '25 13:05 0xDmtri

this is an issue with the 0.1.x branch, if you switch to master it is resolved

Lunarequest avatar May 28 '25 14:05 Lunarequest

I know that it works with master, but considering that master is now locked out of development, it would be a nice idea moving forwards to make telescope work with the main branch, Unfortunately I don't have the know-how that goes into this to be able to help, so all I can do is point it out.

khushmmehta avatar May 29 '25 09:05 khushmmehta

I meant the master branch of telescope

Lunarequest avatar May 29 '25 11:05 Lunarequest

In this case, maybe they could update the documentation to use the master branch

aryklein avatar Jun 07 '25 22:06 aryklein

HI, the master branch of telescope doesn't seem to fix the problem for me.

0fflineuser avatar Jun 08 '25 12:06 0fflineuser

HI, the master branch of telescope doesn't seem to fix the problem for me.

i had the exact same issue and it worked just fine for me

salfel avatar Jun 08 '25 19:06 salfel

@salfel Ah! Yes my bad, I double checked and as I am using lazy.nvim, telescope was written as a dependency to another plugin and there telescope had it's branch set to 0.1.x (don't know why xd) so my actual telescope config didn't properly use the master branch. Now it works! Thanks.

0fflineuser avatar Jun 09 '25 15:06 0fflineuser