enable clangd inlay hints
This commit is contained in:
parent
b8e5f74d25
commit
c6e5307a17
@ -22,7 +22,7 @@ local config = {
|
|||||||
-- Add plugins
|
-- Add plugins
|
||||||
plugins = {
|
plugins = {
|
||||||
-- Extended file type support
|
-- Extended file type support
|
||||||
{ "sheerun/vim-polyglot", lazy = false }, -- Community plugins
|
{ "sheerun/vim-polyglot", lazy = false }, -- Community plugins
|
||||||
"AstroNvim/astrocommunity",
|
"AstroNvim/astrocommunity",
|
||||||
{ import = "astrocommunity.pack.angular" },
|
{ import = "astrocommunity.pack.angular" },
|
||||||
{ import = "astrocommunity.pack.ansible" },
|
{ import = "astrocommunity.pack.ansible" },
|
||||||
@ -79,6 +79,23 @@ local config = {
|
|||||||
"p00f/clangd_extensions.nvim",
|
"p00f/clangd_extensions.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = { extensions = { autoSetHints = true } },
|
opts = { extensions = { autoSetHints = true } },
|
||||||
|
init = function()
|
||||||
|
-- load clangd extensions when clangd attaches
|
||||||
|
local augroup = vim.api.nvim_create_augroup("clangd_extensions", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = augroup,
|
||||||
|
desc = "Load clangd_extensions with clangd",
|
||||||
|
callback = function(args)
|
||||||
|
if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
|
||||||
|
require("clangd_extensions")
|
||||||
|
-- add more `clangd` setup here as needed such as loading autocmds
|
||||||
|
require("clangd_extensions.inlay_hints").setup_autocmd()
|
||||||
|
require("clangd_extensions.inlay_hints").set_inlay_hints()
|
||||||
|
vim.api.nvim_del_augroup_by_id(augroup) -- delete auto command since it only needs to happen once
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"simrat39/rust-tools.nvim",
|
"simrat39/rust-tools.nvim",
|
||||||
|
Loading…
Reference in New Issue
Block a user