SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
770 stars 30 forks source link

attempt to index local 'node' (a nil value) #2

Closed gennaro-tedesco closed 1 year ago

gennaro-tedesco commented 1 year ago

Good afternoon and thank you for always producing great plugins!

I am running

nvim --version
NVIM v0.9.0-dev-1290+g2257ade3d-dirty

and have installed the plugin via lazy.nvim (not that it matters); while attaching it to the language servers as per README (or alternatively by specifying

lsp = {
        auto_attach = true, 
    }

I get the exception (upon invocation of :Navbuddy)

Error executing vim.schedule lua callback: ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:75: attempt to index local 'node' (a nil value)
stack traceback:
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:75: in function 'fill_buffer'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:366: in function 'redraw'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:322: in function 'new'
    ...share/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/init.lua:217: in function 'handler'
    ...share/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/init.lua:165: in function 'handler'
    ....local/share/nvim/lazy/nvim-navic/lua/nvim-navic/lib.lua:267: in function 'callback'
    ...r/neovim/HEAD-2257ade/share/nvim/runtime/lua/vim/lsp.lua:2026: in function 'handler'
    ...r/neovim/HEAD-2257ade/share/nvim/runtime/lua/vim/lsp.lua:1399: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

Subsequently also

Error detected while processing CursorMoved Autocommands for "<buffer=87>":

(or any other buffer number).

The line in question is this one and the method in question is node.parent.

I notice there is a reference to HEAD-2257ade in the stack trace, latest commit on nightly, may that be the cause?

SmiteshP commented 1 year ago

I notice there is a reference to HEAD-2257ade in the stack trace, latest commit on nightly, may that be the cause?

Yeah that looks suspicious 🤔 . Also I noticed dirty added on to your version number, what does that mean? Mine is just showing NVIM v0.9.0-dev-1290+g2257ade3dc

Could you share some minimal C++, python or even lua file where you are able to recreate this issue? I am not able to reproduce it 😓 Also just a hunch, could you try wrapping this line in if not equal to nil check. Let me know if it helps.

ColonelPhantom commented 1 year ago

I seem to be getting the same error in a Python file on Nvim 0.8.3 (with jedi language server). Haven't had the time to look at it more in-depth, though.

yngwi commented 1 year ago

I've got the same error in Nvim Nightly from today with Typescript language server

SmiteshP commented 1 year ago

Tried typescript server. got the error 👍🏽 So my guess is that it is lsp server specific issue. Looking into it

SmiteshP commented 1 year ago

Fixed the issue from nvim-navic side. Can you guys update to latest nvim-navic and let me know if the issue if fixed?

yngwi commented 1 year ago

I don't get the error any more! Thank you!

sf8193 commented 1 year ago

that fixed it for me as well! thanks, very promising plugin

gennaro-tedesco commented 1 year ago

Updating fixes the error for me as well. As far as I am concern, we can close this issue as solved!

ColonelPhantom commented 1 year ago

Seems to work here too!

SmiteshP commented 1 year ago

Closing issue as problem is solved 🥳