Files
.dotfiles/.config/nvim/lua/plugin/lspconfig.lua

42 lines
1.1 KiB
Lua

MiniDeps.add({ source = 'https://github.com/neovim/nvim-lspconfig' })
local opts = {
['clangd'] = false,
['ccls'] = true,
['glsl_analyzer'] = true,
['rust_analyzer'] = true,
['omnisharp'] = false,
['lua_ls'] = true,
['html'] = true,
['cssls'] = true,
['ts_ls'] = true,
['jsonls'] = true,
['yamlls'] = {
settings = {
yaml = {
schemas = {
["https://json.schemastore.org/github-workflow.json"] =
"/.github/workflows/*",
["https://json.schemastore.org/clang-format"] = ".clang-format",
["https://json.schemastore.org/clang-tidy"] = ".clang-tidy",
},
},
},
},
}
-- store the default capabilities
local capabilities = require('blink.cmp').get_lsp_capabilities()
-- enable the LSP
for server, config in pairs(opts) do
if type(config) == 'boolean' then
vim.lsp.enable(server, config)
else
vim.lsp.enable(server, true)
vim.lsp.config[server] = vim.tbl_deep_extend('force', {}, vim.lsp.config[server],
config or {})
end
vim.lsp.config[server].capabilities = capabilities
end