folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
15.06k stars 365 forks source link

Treesitter grammars are not detected when nvim-treesitter is loaded using this plugin manager #74

Closed pianocomposer321 closed 1 year ago

pianocomposer321 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Which version of Neovim are you using? Neovim 0.8.1

To Reproduce I'm using the following config:

plugins.lua:

```lua -- Automatically install and load lazy.nvim on startup local lazypath = vim.fn.stdpath("data") .. "/lazy/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) local plugins = { --- Colorscheme { "olimorris/onedarkpro.nvim", lazy = false, commit = "ceb1ad90a20c39a87799e5f0facfa02d7cb19a23", config = function() vim.cmd("colorscheme onedarkpro") end }, --- Treesitter { "nvim-treesitter/nvim-treesitter", lazy = false, config = require("config.nvim-treesitter").config, run = ":TSUpdate", }, } require("lazy").setup(plugins, { defaults = { lazy = true }, }) ```

config/nvim-treesitter.lua:

```lua return { config = function() require'nvim-treesitter.configs'.setup { auto_install = true, highlight = { enable = true }, incremental_selection = { enable = true, keymaps = { init_selection = "", node_incremental = "", node_decremental = "", } } } end } ```

Expected Behavior When I open a *.lua file, it should install the grammar the first time. Then subsequent times opening the same file (or even just :e<CR>, it should not reinstall it, and it should detect and use the grammar for the colorscheme.

pianocomposer321 commented 1 year ago

Never mind, I think it was a problem with cacheing. Deleteing ~/.local/state/nvim and reinstalling fixed it.

pianocomposer321 commented 1 year ago

Hey @folke, do you think this should be documented at all? I think the issue occurred either because I was useing packer.nvim before, or because I was using impatient.nvim before. Both of those are things that you could reasonably expect to be the case for people switching to this plugin, so I would assume that someone else will run into this issue at some point in the future.

folke commented 1 year ago

It was a bug in the cache. Has been fixed in the meantime

lewis6991 commented 1 year ago

I'm hitting this issue too. Removing ~/.local/state/nvim didn't fix the issue.

folke commented 1 year ago

@lewis6991 do you have a packer compiled file lingering around? What is the error you get?

zzSunil commented 1 year ago

I'm hitting this issue too. Removing ~/.local/state/nvim didn't fix the issue.

delete origin treesitter dir in plugged fix it for me