linrongbin16 / lsp-progress.nvim

A performant lsp progress status for Neovim.
https://linrongbin16.github.io/lsp-progress.nvim/
MIT License
213 stars 8 forks source link

Error with basic Lazy installation #132

Closed igillis-clara closed 7 months ago

igillis-clara commented 7 months ago

Before even incorportaing lsp-progress into lualine, I'm getting an error just configuring it with Lazy:

{
  "linrongbin16/lsp-progress.nvim",
  config = function()
    require("lsp-progress").setup()
  end,
}

gives CleanShot 2024-04-01 at 13 02 37@2x

linrongbin16 commented 7 months ago

hi @igillis-clara ,

the setup looks good to me, can you share the source code lsp.lua: 143 that throws the error?

igillis commented 7 months ago

It's just this line

      require('lsp-progress').setup()

Very strange. My understanding is that require returns true when the module you call it on doesn't return anything, but I'm not sure how that's possible.

linrongbin16 commented 7 months ago

hi @igillis ,

can you share your nvim config's github repo? (if you use it to maintain your nvim config) I could take a look at it.

igillis commented 7 months ago

Good idea, it's here: https://github.com/igillis/neovim

I just pushed the commented out attempt I made at incorporating lsp-progress

linrongbin16 commented 7 months ago

hi @igillis ,

the config looks good, but I found lualine doesn't depend on lsp-progress, check: https://github.com/igillis/neovim/blob/ab84d67cfeb26c4c95655414555ec497cde0ad23/lua/plugins/lualine.lua#L4

maybe add lsp-progress as lualine dependency, and try again.

linrongbin16 commented 7 months ago

hi @igillis ,

This issue could be the same as #131 .

You can try setup lualine/lsp-progress with lazy like this:

lualine_c = {
    function()
        return require("lsp-progress").progress()
    end,
},

Note: use function() ... end to wrap the progress API, this can help avoid the lazy dependency issue.

igillis commented 7 months ago

Yes that fixed the error! Not showing anything in lualine just yet but that's presumably a different issue.

Thanks -- feel free to close this out.