Files
AstroConfig/lua/plugins/20-lsp.lua
2024-03-16 11:21:46 +01:00

38 lines
1.1 KiB
Lua

---@type LazySpec
return {
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
features = {
autoformat = false,
inlay_hints = false, -- BUG: upstream https://github.com/neovim/neovim/issues/27645
},
formatting = {
format_on_save = {
enabled = false,
},
timeout_ms = 1000,
},
mappings = {
n = {
gh = {
function() require("clangd_extensions.switch_source_header").switch_source_header() end,
desc = "Switch to matching source or header file",
cond = "textDocument/switchSourceHeader",
},
},
},
---@diagnostic disable: missing-fields
config = {
clangd = {
filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
cmd = {
"clangd",
"--header-insertion=never", -- Disable auto includes
"--enable-config", -- Enable .clangd and clangd.yaml files
},
},
},
},
}