Skip to content

Treesitter picker is broken on main branch of nvim-treesitter #3547

@mystilleef

Description

@mystilleef

Description

The nvim-treesitter master branch is deprecated in favor of the main branch. When using the main branch, the treesitter picker no longer works with Telescope.

Neovim version

NVIM v0.12.0-nightly+323d552
Build type: Release
LuaJIT 2.1.1741730670

Operating system and version

Fedora Linux 42 (Workstation Edition) x86_64

Telescope version / branch / rev

master

checkhealth telescope

telescope:                                                                  ✅

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

Checking external dependencies ~
- ✅ OK rg: found ripgrep 15.0.0
- ✅ OK fd: found fd 10.3.0

===== Installed extensions ===== ~

Telescope Extension: `emoji` ~
- No healthcheck provided

Telescope Extension: `hop` ~
- No healthcheck provided

Telescope Extension: `neoclip` ~
- No healthcheck provided

Telescope Extension: `persisted` ~
- No healthcheck provided

Telescope Extension: `smart_history` ~
- No healthcheck provided

Telescope Extension: `spell_errors` ~
- No healthcheck provided

Steps to reproduce

  1. nvim -nu minimal.lua somefile.lua
  2. :Telescope treesitter

Expected behavior

Treesitter picker opens without errors.

Actual behavior

I get the following error:

Lua :command callback: ...im/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:426: attempt to call field 'get_buf_lang' (a nil value)
stack traceback:
        ...im/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:426: in function 'v'
        ...im/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:645: in function 'v'
        .../nvim/lazy/telescope.nvim/lua/telescope/builtin/init.lua:587: in function <.../nvim/lazy/telescope.nvim/lua/telescope/builtin/init.lua:546>
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:188: in function 'run_command'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
        ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>

Minimal config

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system {
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
      { "nvim-treesitter/nvim-treesitter", branch = "main", run = ":TSUpdate" },
    },
    config = function()
      -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
      require("telescope").setup {}
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions