update to mason 2.0
This commit is contained in:
parent
f639d03f6c
commit
42c1f0b966
2 changed files with 37 additions and 42 deletions
|
|
@ -1,15 +1,10 @@
|
|||
local lspconfig = require "lspconfig"
|
||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
local on_attach = require("nvchad.configs.lspconfig").on_init
|
||||
-- local lspconfig = require "lspconfig"
|
||||
-- local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
-- local on_attach = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities
|
||||
require("mason-lspconfig").setup()
|
||||
require("mason-lspconfig").setup_handlers {
|
||||
function(name)
|
||||
lspconfig[name].setup {}
|
||||
end,
|
||||
}
|
||||
-- if you just want default config for the servers then put them in a table
|
||||
local servers = {
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup {
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"cssls",
|
||||
"clangd",
|
||||
|
|
@ -27,14 +22,7 @@ local servers = {
|
|||
"ruff",
|
||||
"jdtls",
|
||||
"nil_ls",
|
||||
},
|
||||
}
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
require("copilot").setup()
|
||||
|
|
|
|||
|
|
@ -9,12 +9,20 @@ return {
|
|||
-- LSP Stuff
|
||||
-- TODO: make these lang specific
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
"mason/mason.nvim",
|
||||
-- opts = overrides.mason
|
||||
opts = {
|
||||
PATH = "append",
|
||||
},
|
||||
},
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"cbochs/grapple.nvim",
|
||||
|
|
@ -50,7 +58,6 @@ return {
|
|||
end, -- Override to setup mason-lspconfig
|
||||
dependencies = {
|
||||
"nvimdev/lspsaga.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
lazy = false,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue