Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use with Lazy.nvim starter #305

Open
aleyrizvi opened this issue Jun 3, 2024 · 6 comments
Open

Unable to use with Lazy.nvim starter #305

aleyrizvi opened this issue Jun 3, 2024 · 6 comments

Comments

@aleyrizvi
Copy link

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
Copy link
Owner

ray-x commented Jun 3, 2024

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

@aleyrizvi
Copy link
Author

aleyrizvi commented Jun 3, 2024

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
Copy link
Owner

ray-x commented Jun 4, 2024

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

@PerMalmberg
Copy link

PerMalmberg commented Jun 15, 2024

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
Copy link

Found it:

vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(require('navigator.hover').handler, {

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
Copy link
Owner

ray-x commented Jun 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants