30 lines
717 B
Lua
30 lines
717 B
Lua
|
local mason = require("mason")
|
||
|
local lspconfig = require("lspconfig")
|
||
|
local mason_lspconfig = require("mason-lspconfig")
|
||
|
|
||
|
mason.setup()
|
||
|
mason_lspconfig.setup()
|
||
|
|
||
|
lspconfig.util.default_config = vim.tbl_extend("force", lspconfig.util.default_config, {
|
||
|
on_attach = require("plugins.configs.lsp.handlers").on_attach,
|
||
|
capabilities = require("plugins.configs.lsp.handlers").capabilities,
|
||
|
})
|
||
|
|
||
|
mason_lspconfig.setup_handlers({
|
||
|
function(server_name)
|
||
|
lspconfig[server_name].setup({})
|
||
|
end,
|
||
|
["jsonls"] = function()
|
||
|
local schemastore = require("schemastore")
|
||
|
|
||
|
lspconfig.jsonls.setup({
|
||
|
settings = {
|
||
|
json = {
|
||
|
schemas = schemastore.json.schemas(),
|
||
|
validate = { enable = true },
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
end,
|
||
|
})
|