28 lines
602 B
Lua
28 lines
602 B
Lua
local map = core.misc.map
|
|
|
|
return {
|
|
on_attach = function(_, bufnr)
|
|
-- add some clangd specific mappings
|
|
local opts = { buffer = bufnr }
|
|
map("n", "<leader>o", "<cmd>ClangdSwitchSourceHeader<CR>", opts)
|
|
end,
|
|
|
|
cmd = {
|
|
"clangd",
|
|
"--background-index",
|
|
"--clang-tidy",
|
|
"--header-insertion=iwyu",
|
|
"--completion-style=detailed",
|
|
"--function-arg-placeholders",
|
|
"--fallback-style=llvm"
|
|
},
|
|
|
|
init_options = {
|
|
usePlaceholders = true,
|
|
clangdFileStatus = true,
|
|
fallback_flags = {
|
|
"-xc" -- makes clangd think we"re using c instead of c++
|
|
}
|
|
}
|
|
}
|