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.29k stars 58 forks source link

Confusing result when pressing c-n/p #279

Closed jonashaag closed 1 year ago

jonashaag commented 1 year ago

Sorry for the dumb question, I'm pretty new to Neovim and LSP setup.

The autocomplete suggestions are pretty reasonable, Python example:

Screenshot 2023-06-02 at 15 12 22

However when I press C-n to select the first entry, the list of results changes:

Screenshot 2023-06-02 at 15 12 30

Also, the documentation/annotation seems to be gone.

I'd also like to have function documentation when I select an element:

Screenshot 2023-06-02 at 15 12 46

Is there anything else interacting with C-n/p?

```lua return { { "hrsh7th/nvim-cmp", dependencies = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-path", "hrsh7th/cmp-buffer" }, config = function() local cmp = require("cmp") cmp.setup({ sources = { { name = "nvim_lsp" }, { name = "path" }, { name = "buffer" } }, }) end, }, { "ray-x/lsp_signature.nvim", }, { "neovim/nvim-lspconfig", config = function() for _, lsp in ipairs({ "pyright" }) do require("lspconfig")[lsp].setup({ on_attach = function() require("lsp_signature").on_attach() end, }) end end, }, { "ray-x/navigator.lua", dependencies = { { "ray-x/guihua.lua", build = "cd lua/fzy && make" }, "ray-x/lsp_signature.nvim", "neovim/nvim-lspconfig", "nvim-treesitter/nvim-treesitter", }, config = function() require("navigator").setup({ debug = true, keymaps = { { key = "", func = vim.lsp.buf.signature_help, }, }, }) end, }, } ```
ray-x commented 1 year ago

Not so sure about your setup, Are you using nvim-cmp for autocomplete ?

jonashaag commented 1 year ago

Yes, see the "Details" button in my post, it contains the entire LSP related setup.

ray-x commented 1 year ago

The provider in your case is cmp which will override <C-n/p> setup You have to config cmp in this case.

e.g. https://github.com/ray-x/nvim/blob/7e1578b5762b40df6f7e93d2b5bcb5032ab6ec83/lua/modules/completion/config.lua#L133-L136

jonashaag commented 1 year ago

Ah thanks!