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

bug: Treesitter error if parser not found #4

Closed
iovis opened this issue Aug 8, 2024 · 2 comments
Closed

bug: Treesitter error if parser not found #4

iovis opened this issue Aug 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@iovis
Copy link

iovis commented Aug 8, 2024

Neovim version (nvim -v)

v0.10.1

Operating system/version

macOS

Describe the bug

When trying to highlight items that don't have a TS parser, it throws the following error:

"nvim/.config/nvim/lua/plugins/quicker.lua" 29L, 628B
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'git_config' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'get_string_parser'
...l/share/nvim/lazy/quicker.nvim/lua/quicker/highlight.lua:181: in function 'get_heuristic_ts_highlights'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:269: in function <...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:225>
[C]: in function 'xpcall'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:128: in function <...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:116>
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'tmux' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'get_string_parser'
...l/share/nvim/lazy/quicker.nvim/lua/quicker/highlight.lua:181: in function 'get_heuristic_ts_highlights'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:269: in function <...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:225>
[C]: in function 'xpcall'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:128: in function <...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:116>
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'tmux' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'get_string_parser'
...l/share/nvim/lazy/quicker.nvim/lua/quicker/highlight.lua:181: in function 'get_heuristic_ts_highlights'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:269: in function <...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:225>
[C]: in function 'xpcall'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:128: in function 'do_next_highlight'
...cal/share/nvim/lazy/quicker.nvim/lua/quicker/display.lua:139: in function ''
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

What is the severity of this bug?

tolerable (can work around it)

Steps To Reproduce

  1. Perform a search that would span files that don't have an installed TS parser
  2. Error pops up

Expected Behavior

I think it's reasonable to just not do syntax highlight for files that don't have TS enabled

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
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.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/quicker.nvim",
    config = function()
      require("quicker").setup({
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

IMG_0901
IMG_0902

@iovis iovis added the bug Something isn't working label Aug 8, 2024
@iovis
Copy link
Author

iovis commented Aug 8, 2024

Beautiful plugin, btw. I was hoping for something like this!

@stevearc
Copy link
Owner

stevearc commented Aug 8, 2024

Fixed, thanks for the report!

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