SmiteshP / nvim-navbuddy

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

Getting issue while renaming symbol [lazy.nvim] #37

Closed insomnia-creator closed 1 year ago

insomnia-creator commented 1 year ago

My setup file looks like this:

local navbuddy = require("nvim-navbuddy")

navbuddy.setup {
  lsp = {
    auto_attach = true
  }
}

Installation via Lazy.nvim

 {
    "SmiteshP/nvim-navbuddy",
    dependencies = {
        "MunifTanjim/nui.nvim",
        "SmiteshP/nvim-navic"
    },
    lazy = false
  },

https://user-images.githubusercontent.com/69950985/230593308-73356fb5-fc11-42c0-ab62-95e16597bd82.mov

Error recieved:

E5108: Error executing lua: ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/actions.lua:222: attempt to call
field 'rename' (a table value)
stack traceback:
        ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/actions.lua:222: in function 'v'
        ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:198: in function <...re/nvim/lazy/nvim-na
vbuddy/lua/nvim-navbuddy/display.lua:197>

Additional information:

---Navbuddy is being opened by the following map key:
  map('n', "<leader>v", ":lua require('nvim-navbuddy').open() <CR>", {silent = true})

Just doing a fresh installation and following instructions from README

SmiteshP commented 1 year ago

Not able to reproduce the issue? 🤔 Which version of neovim are you using? Can you move your cursor over some variable name or function name and try this command

:lua vim.lsp.buf.rename()

This should help us isolate if the issue is caused by navbuddy or something else.

insomnia-creator commented 1 year ago
Screenshot 2023-04-09 at 10 45 01 AM

Looks like it is a neovim issue and not a navbuddy issue.

I'm using Neovim version NVIM v0.9.0-dev-16-g56998feeb

insomnia-creator commented 1 year ago

@SmiteshP Looks like I found the issue. After inspecting the vim.lsp.buf.rename table, I found the .float function which does exactly what I was looking for, this maybe a thing in the newer versions of neovim.

Running :lua vim.lsp.buf.rename.float() after hovering works fine! This is a pre-release version so I'll be closing the issue here, do patch this later on.

https://user-images.githubusercontent.com/69950985/230756020-9409616a-3eff-4044-a782-a149ba5e456d.mov