Skip to content

Commit

Permalink
fix: inlay hints confuse for clangd
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Apr 21, 2024
1 parent f3c6b1e commit cdc5c22
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lua/aceforeverd/lsp/servers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ return {
)
vim.keymap.set(
'n',
'<C-w>av',
'<Leader>av',
'<c-w>v<cmd>ClangdSwitchSourceHeader<cr>',
{ noremap = true, silent = true, buffer = bufnr, desc = 'switch source (vsplit)' }
)
vim.keymap.set(
'n',
'<C-w>as',
'<Leader>as',
'<c-w>s<cmd>ClangdSwitchSourceHeader<cr>',
{ noremap = true, silent = true, buffer = bufnr, desc = 'switch source (split)' }
)
Expand All @@ -105,7 +105,15 @@ return {
{ noremap = true, silent = true, buffer = bufnr, desc = 'toggle inlay hints' }
)

require("clangd_extensions.inlay_hints").setup_autocmd()
vim.keymap.set(
'n',
'<Leader>al',
'<cmd>ClangdSetInlayHints<cr>',
{ noremap = true, silent = true, buffer = bufnr, desc = 'refresh inlay hints' }
)

-- inlay hints autocmd get confused with :ClangdToggleInlayHints, a workaround is toggle manually
-- require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()

-- use lsp-status only for clangd
Expand Down

0 comments on commit cdc5c22

Please sign in to comment.