tsakirist / telescope-lazy.nvim

Telescope extension that provides handy functionality about plugins installed via lazy.nvim
MIT License
111 stars 2 forks source link

BUG: Search does not work when using 'import = plugin' before plugin spec #9

Closed kevintraver closed 4 months ago

kevintraver commented 4 months ago

Steps to reproduce:

require("lazy").setup({
    spec = {
        { "LazyVim/LazyVim", import = "lazyvim.plugins" },
        { import = "plugins" },
        {
          "polirritmico/telescope-lazy-plugins.nvim",
          config = function()
            require("telescope").setup({
              extensions = {
                lazy_plugins = {},
              },
            })
            require("telescope").load_extension("lazy_plugins")
          end,
        },
      }
    )}

In plugins file, if the import is before the plugin, then searching for the plugin (in this case searching for 'octo') does not work and incorrectly links to local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

This does not work:

-- lua/plugins/octo.lua
return {
  { import = "lazyvim.plugins.extras.lang.git" },
  {
    "pwntester/octo.nvim",
  },
}

this does work:

-- lua/plugins/octo.lua
return {
  {
    "pwntester/octo.nvim",
  },
  { import = "lazyvim.plugins.extras.lang.git" },
}
kevintraver commented 4 months ago

Sorry, opened this in the wrong repo.