ray-x / navigator.lua

Code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐 Exploring LSP and 🌲Treesitter symbols a piece of 🍰 Take control like a boss 🦍
MIT License
1.26k stars 54 forks source link

Unable to use with Lazy.nvim starter #305

Open aleyrizvi opened 1 month ago

aleyrizvi commented 1 month ago

Hi, I am very new with neovim and I am having the following error after installing navigator.lua

vim.lsp.handlers["textDocument/hover"]` has been overwritten by another plugin?

Either disable the other plugin or set `config.lsp.hover.enabled = false` in your **Noice** config.
  - plugin: nvim
  - file: /opt/homebrew/Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua
  - line: 1159

Can you please tell me what needs to be done and how to solve it?

ray-x commented 1 month ago

I have not seen this so far. What operation triggered this issue? Is it reproducible with the sample init.lua

aleyrizvi commented 1 month ago

It seems to working with this init.lua but I am not sure how to check properly.

Here is my config with navigator activated. https://github.com/aleyrizvi/nvim-config

the plugin is in https://github.com/aleyrizvi/nvim-config/blob/main/lua/plugins/navigator.lua

Screenshot 2024-06-03 at 20 40 58
ray-x commented 1 month ago

Looks like you have mason installed/configed Please check the README.md regarding how to setup to work with mason.

PerMalmberg commented 2 weeks ago

I got this error message too (I'm also using LazyVim). If you follow the instructions in the error message, it goes away, though that also partly disables noice.nvim

I can only assume that navigator also sets vim.lsp.handlers, correct @ray-x ?

Here's an example config to 'fix' the error:

return
{
    "folke/noice.nvim",
    event = "VeryLazy",
    opts = {
        lsp = {
            hover = {
                enabled = false,
            },
            signature = {
                enabled = false,
            },
        },
    },
    dependencies = {
        -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
        "MunifTanjim/nui.nvim",
        -- OPTIONAL:
        --   `nvim-notify` is only needed, if you want to use the notification view.
        --   If not available, we use `mini` as the fallback
        "rcarriga/nvim-notify",
    },
}
PerMalmberg commented 2 weeks ago

Found it: https://github.com/ray-x/navigator.lua/blob/3be5241bf902b8492ce3923cb62d9b44c4831b59/lua/navigator/lspclient/mapping.lua#L454

I actually get a second error (see screenshot), hence the two settings in the example above, but I can't see that navigator sets the second one, except in playground/init.lua

image

ray-x commented 2 weeks ago

look like hover&signature is not disabled in noice config. You can alternatively disable hover in navigator/init.lua.