p00f / clangd_extensions.nvim

Clangd's off-spec features for neovim's LSP client. Use https://sr.ht/~p00f/clangd_extensions.nvim instead
MIT License
448 stars 16 forks source link

The plugin overrides K -> `Show hover.` #19

Closed Dich0tomy closed 2 years ago

Dich0tomy commented 2 years ago

I'm using LunarVim. Without the plugin the K keymap would show me information about the function. With the plugin it removes that keymap and my lunarvim tries to issue man.

I thought hover_with_actions causes that so I set it to false, still the same thing.

I'm using clangd, neovim version v0.7.0, lunarvim version e1d32ca.

EDIT: just checked and it apparently also overrides gd (goto defintion). Probably some more things?

p00f commented 2 years ago

Nope it does not map anything in normal buffers


p00f@ganymede $ rg map
lua/clangd_extensions/inlay_hints.lua
88:    local map = {}
101:            if map[line] ~= nil then
102:                table.insert(map[line], { label = label, kind = kind })
104:                map[line] = { { label = label, kind = kind } }
116:    return map

lua/clangd_extensions/memory_usage.lua
33:    api.nvim_buf_set_keymap(buf, "n", "q", ":bd<CR>", {
34:        noremap = true,
37:    api.nvim_buf_set_keymap(buf, "n", "<ESC>", ":bd<CR>", {
38:        noremap = true,
p00f commented 2 years ago

btw hover_with_actions doesn't do anything, it's a leftover. I've removed it now

Dich0tomy commented 2 years ago

@p00f Alright. I'll try check it again. If I don't give server to the config does it override the options passed to lspconfig? Maybe LunarVim dumbly registers things there, idk. I'll check when I get home.

xeluxee commented 1 year ago

I've experienced the same issue with LunarVim. Use the following setup to fix it

require("clangd_extensions").setup {
  server = {
    on_attach = require("lvim.lsp").common_on_attach,
    on_init = require("lvim.lsp").common_on_init,
    capabilities = require("lvim.lsp").common_capabilities(),
  }
}