52 lines
1.3 KiB
Lua
52 lines
1.3 KiB
Lua
---@module 'lazy'
|
|
---@type LazySpec
|
|
return { {
|
|
'neovim/nvim-lspconfig',
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
dependencies = { 'saghen/blink.cmp' },
|
|
---@type table<string, boolean|vim.lsp.Config>
|
|
opts = {
|
|
['clangd'] = true,
|
|
['ccls'] = false,
|
|
['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",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
---@param opts table<string,boolean|vim.lsp.Config>
|
|
config = function(_, opts)
|
|
-- 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
|
|
end
|
|
} }
|