navigator.lua icon indicating copy to clipboard operation
navigator.lua copied to clipboard

Unable to use with Lazy.nvim starter

Open aleyrizvi opened this issue 1 year ago • 6 comments

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?

aleyrizvi avatar Jun 03 '24 02:06 aleyrizvi

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

ray-x avatar Jun 03 '24 05:06 ray-x

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

aleyrizvi avatar Jun 03 '24 17:06 aleyrizvi

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

ray-x avatar Jun 04 '24 00:06 ray-x

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 avatar Jun 15 '24 13:06 PerMalmberg

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

PerMalmberg avatar Jun 15 '24 13:06 PerMalmberg

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

ray-x avatar Jun 16 '24 02:06 ray-x