polirritmico / telescope-lazy-plugins.nvim

A Telescope picker to quickly access configurations of plugins managed by lazy.nvim.
MIT License
52 stars 1 forks source link

Not working after lazy.nvim update (>=11.0) #10

Closed polirritmico closed 2 months ago

polirritmico commented 3 months ago

lazy.nvim reimplements the way it resolves the spec and no longer store the module field inside spec.plugins.

Bisecting points to this commit

i3d commented 2 months ago

Any updates? I like this plugin since it helps me rapidly locate the plugins I need to edit... so I am holding off updating lazy.nvim before this is fixed.

polirritmico commented 2 months ago

Hi. I'm currently working on this on the post-11.0 branch. Is working for me, but fails for LazyVim, so I haven't merged to main yet. But its almost there.

You can try it adding branch = "post-11.0", to the plugin spec to check it out.

i3d commented 2 months ago

I see, thanks for the update. I can perhaps wait a bit

i3d commented 2 months ago

Curious enough, I just gave a try of post-11.0 and I got this

Error executing Lua callback: ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:243: attempt to index local 'inner_spec' (a function value)
stack traceback:
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:243: in function 'import'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:210: in function 'expand_import'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:253: in function 'import'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:263: in function 'collect_fragments'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:328: in function 'get_plugins_data'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:356: in function 'finder'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:29: in function <...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:10>
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
        ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>

And I am not using LazyVim. What is interesting enough is that this happens when the :Telescope lazy_plugins called the first time from a new vim session, if I call the same thing second time, it renders the window with empty plugins.

polirritmico commented 2 months ago

@i3d Could you check with the latest commit (b7d5db9)?

i3d commented 2 months ago

wow, yes, it worked!

i3d commented 2 months ago

ok looks like one more thing to fix...

I have plugins only with url spec, aka, no name, the mod is like this

{
    enabled = true,
     url = "sso://uri/path/blah",
}

this is supported by lazy spec, but looks like the finder assumes it must have a name, so when parsing this mod, it got this error

Error executing Lua callback: ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:282: attempt to index local 'repo_name' (a nil value)
stack traceback:
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:282: in function 'extract_plugin_info'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:316: in function 'build_plugins_collection'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:341: in function 'get_plugins_data'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/finder.lua:369: in function 'finder'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:29: in function <...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:10>
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
        ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>

For me, it's totally fine not to parse this plugin (as it is something coming from our internal repo). But since url is a supported feature, I guess you can make a call.

polirritmico commented 2 months ago

I have plugins only with url spec, aka, no name, the mod is like this

{
    enabled = true,
     url = "sso://uri/path/blah",
}

Thanks for the info! Solved that by f453c6c.

i3d commented 2 months ago

I've seen a loooot of these logging

Can't find 'windwp/nvim-autopairs' from line 1 inside the '/home/i3d/.config/nvim/lua/plugins/autopair.lua' file. Maybe a duplicate fragment.
Can't find 'hrsh7th/cmp-cmdline' from line 1 inside the '/home/i3d/.config/nvim/lua/plugins/cmd.lua' file. Maybe a duplicate fragment.
Can't find 'weilbith/nvim-code-action-menu' from line 1 inside the '/home/i3d/.config/nvim/lua/plugins/codeaction.lua' file. Maybe a duplicate fragment.
Can't find 'yorickpeterse/nvim-grey' from line 1 inside the '/home/i3d/.config/nvim/lua/plugins/color.lua' file. Maybe a duplicate fragment.

but otherwise, doesn't seem affect anything, any thoughts why they are flooded so badly?

polirritmico commented 2 months ago

I have a guess about this. Could you check the latest commit ~(086bb1a)~? I was addressing an issue with duplicate entries and maybe they have the same root cause.

i3d commented 2 months ago

hmm... currently @9583137 but still seeing it on every first load from a new nvim session.

polirritmico commented 2 months ago

I could reproduce it

polirritmico commented 2 months ago

Ok. Now it should be working. It was a silly mistake. @i3d could you try it?

Thanks!

i3d commented 2 months ago

ok, upgraded, but looks like instead of not seeing the logs, it changed a bit, from line 1 to line 0.

Can't find 'windwp/nvim-autopairs' from line 0 inside the ...
i3d commented 2 months ago

There is a stacktrace at the end

Can't find 'mrjones2014/smart-splits.nvim' from line 0 inside the '/home/i3d/.config/nvim/lua/plugins/window.lua' file. Maybe a duplicate fragment.
Error executing Lua callback: Keyboard interrupt
stack traceback:
        [C]: in function 'win_gettype'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:236: in function 'new'
        ...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:26: in function <...s.nvim/lua/telescope/_extensions/lazy_plugins/picker.lua:10>
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'
        ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>

if it helps.

polirritmico commented 2 months ago

Could you share one of those offending files? Can't reproduce it with the latests changes.

Edit: Also, what is the output of :checkhealth telescope?

polirritmico commented 2 months ago

I'm going to close this and merge the branch into main since we are addressing another issue here that I could not reproduce without further info, and the plugin is actually working with lazy >= v11.0.

Thanks a lot @i3d for your help, it is greatly appreciated! Of course, if the issue persists or if you have any other problem/suggestion, please open a new issue.

adinhodovic commented 2 months ago

Gracias @polirritmico !!