folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.12k stars 172 forks source link

bug v3: requires Treesitter `markdown_inline` #413

Closed jpmcb closed 1 month ago

jpmcb commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.4 Release

Operating system/version

macOS 13.3

Describe the bug

After a fresh install, toggling into Trouble opens the window pane but yields this error:

...0.9.4/share/nvim/runtime/lua/vim/treesitter/language.lua:93: no parser for 'markdown_inline' language, see :help treesitter-parsers
Press ENTER or type command to continue

which persists and keeps repeating until it eventually fills the screen and requires :q many times to quit or it just crashes:

Screenshot 2024-04-04 at 10 19 42 PM

I was able to unblock this by :TSInstall markdown_inline and adding:

    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        ensure_installed = {
            "markdown_inline",
        },
        auto_install = true,
    },

to my inline Lazy.nvim config. Was there something I was missing in the install instructions? I just took the recommended install whole-sale from the README.md.

Steps To Reproduce

  1. :TSUninstall markdown_inline
  2. Open a file and <leader>xx

Expected Behavior

I'd expect:

  1. Treesitter to be required by the plugin
  2. The necessary treesitter parsers to come "batteries included" with the trouble.nvim install

Repro

-- 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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/trouble.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

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

-- TODO: late night, working on reproducing this, will come back with a minimal Lua to reproduce
folke commented 1 month ago

Thank you for reporting!

I updated the docs that either Neovim 0.10.0 or the markdown treesitter parsers are required and also added a check during setup.

gagefonk commented 1 month ago

I'm not sure if i should open a new issue, or just comment here since it was 'recently' closed, please let me know if i should make a new issue @folke. After the checks from 307f271, my trouble is broken now. I keep getting the error that i need to be on neovim 0.10.0 or have markdown/markdown_inline installed.

While I do have both markdown/markdown_inline installed, it's still throwing an error for me. When I commented out the checks from this last commit, the plugin loaded fine and works like normal.

folke commented 1 month ago

@gagefonk what version of Neovim are you on? What does :=vim.treesitter.language.add('markdown') show? (and same for inline)

gagefonk commented 1 month ago

im on 0.9.5, this is from running the command: Screenshot 2024-05-12 at 22 25 13 this is my treesitter lazyspec, and the info from TSModuleInfo showing it's installed: Screenshot 2024-05-12 at 22 27 40 Screenshot 2024-05-12 at 22 27 08

folke commented 1 month ago

ok, thanks. It's probably becuase noice is loaded before nvim-treesitter. Will work on a fix!

folke commented 1 month ago

I've just pushed a fix. Let me know if you still experience issues.