mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(lang): added extra for c/c++
This commit is contained in:
parent
1d6ce4fc57
commit
cb797dc785
1 changed files with 58 additions and 0 deletions
58
lua/lazyvim/plugins/extras/lang/clangd.lua
Normal file
58
lua/lazyvim/plugins/extras/lang/clangd.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
|
||||
-- add c/c++ to treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, { "c", "cpp" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- correctly setup lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"p00f/clangd_extensions.nvim",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
clangd = {},
|
||||
},
|
||||
setup = {
|
||||
clangd = function(_, opts)
|
||||
require("clangd_extensions").setup({
|
||||
server = opts,
|
||||
extensions = {
|
||||
ast = {
|
||||
--These require codicons (https://github.com/microsoft/vscode-codicons)
|
||||
role_icons = {
|
||||
type = "",
|
||||
declaration = "",
|
||||
expression = "",
|
||||
specifier = "",
|
||||
statement = "",
|
||||
["template argument"] = "",
|
||||
},
|
||||
|
||||
kind_icons = {
|
||||
Compound = "",
|
||||
Recovery = "",
|
||||
TranslationUnit = "",
|
||||
PackExpansion = "",
|
||||
TemplateTypeParm = "",
|
||||
TemplateTemplateParm = "",
|
||||
TemplateParamObject = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue