Make lspconfig auto setup upon MasonInstall
This commit is contained in:
parent
0855935763
commit
2665b719de
|
@ -13,6 +13,8 @@ M.treesitter = {
|
|||
"cpp",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"rust",
|
||||
"svelte",
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
|
@ -48,6 +50,31 @@ M.mason = {
|
|||
},
|
||||
}
|
||||
|
||||
M.mason_lspconfig = {
|
||||
ensure_installed = {},
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
function (server_name)
|
||||
require("lspconfig")[server_name].setup{
|
||||
on_attach = require("plugins.configs.lspconfig").on_attach,
|
||||
capabilities = require("plugins.configs.lspconfig").capabilities,
|
||||
}
|
||||
end,
|
||||
|
||||
["lua_ls"] = function ()
|
||||
require("lspconfig").lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
-- git support in nvimtree
|
||||
M.nvimtree = {
|
||||
git = {
|
||||
|
|
|
@ -4,7 +4,6 @@ local overrides = require("custom.configs.overrides")
|
|||
local plugins = {
|
||||
|
||||
-- Override plugin definition options
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
|
@ -15,17 +14,23 @@ local plugins = {
|
|||
require "custom.configs.null-ls"
|
||||
end,
|
||||
},
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
-- Use mason-lspconfig hooks instead
|
||||
-- require "custom.configs.lspconfig"
|
||||
end, -- Override to setup mason-lspconfig
|
||||
},
|
||||
|
||||
-- override plugin configs
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = overrides.mason
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
opts = overrides.mason
|
||||
},
|
||||
opts = overrides.mason_lspconfig,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue