Skip to content
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

Error on text files in Telescope find_files #3371

Open
samyhaff opened this issue Nov 28, 2024 · 2 comments
Open

Error on text files in Telescope find_files #3371

samyhaff opened this issue Nov 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@samyhaff
Copy link

samyhaff commented Nov 28, 2024

Description

When highlighting text (.txt) files in Telescope find_files, the following error is shown:

Error executing vim.schedule lua callback: ...99671/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'text' language, see :help treesitter-pars
ers
stack traceback:
        [C]: in function 'error'
        ...99671/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'has_ts_parser'
        ...m/lazy/telescope.nvim/lua/telescope/previewers/utils.lua:173: in function 'ts_highlighter'
        ...m/lazy/telescope.nvim/lua/telescope/previewers/utils.lua:154: in function 'highlighter'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:233: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

This happens on latest master, not on releases.

Neovim version

NVIM v0.11.0-dev-614+g419967104-Homebrew
Build type: Release
LuaJIT 2.1.1724512491

Operating system and version

macOS 15.0.1

Telescope version / branch / rev

master

checkhealth telescope

==============================================================================
telescope: require("telescope.health").check()

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

Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 10.1.0

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

Steps to reproduce

  1. :Telescope find_files
  2. Highlight any .txt file

Expected behavior

No error

Actual behavior

Error executing vim.schedule lua callback: ...99671/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'text' language, see :help treesitter-pars
ers
stack traceback:
        [C]: in function 'error'
        ...99671/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'has_ts_parser'
        ...m/lazy/telescope.nvim/lua/telescope/previewers/utils.lua:173: in function 'ts_highlighter'
        ...m/lazy/telescope.nvim/lua/telescope/previewers/utils.lua:154: in function 'highlighter'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:233: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

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",
    },
    config = function()
      -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
      require("telescope").setup {}
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
@samyhaff samyhaff added the bug Something isn't working label Nov 28, 2024
@ecerulm
Copy link
Contributor

ecerulm commented Dec 8, 2024

Related: #3332

@ecerulm
Copy link
Contributor

ecerulm commented Dec 8, 2024

I had the same problem and I was using nightly build version of nvim, I had to upgrade from NVIM v0.11.0-dev-492+g0cdeb06db to NVIM v0.11.0-dev-1321+gfe1e2eff06 to resolve the issue.

I also tested on NVIM 0.10.2 and I don't see the problem either, so I guess you only see this if you are using an old unreleased/development version of nvim 0.11.0-dev

I see now you said

This happens on latest master, not on releases.

well, it seems resolved NVIM v0.11.0-dev-1321+gfe1e2eff06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants