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 lspconfig = require "lspconfig"
|
||||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
-- local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||||
local on_attach = require("nvchad.configs.lspconfig").on_init
|
-- local on_attach = require("nvchad.configs.lspconfig").on_init
|
||||||
local capabilities
|
local capabilities
|
||||||
require("mason-lspconfig").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup_handlers {
|
require("mason-lspconfig").setup {
|
||||||
function(name)
|
ensure_installed = {
|
||||||
lspconfig[name].setup {}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
-- if you just want default config for the servers then put them in a table
|
|
||||||
local servers = {
|
|
||||||
"html",
|
"html",
|
||||||
"cssls",
|
"cssls",
|
||||||
"clangd",
|
"clangd",
|
||||||
|
|
@ -27,14 +22,7 @@ local servers = {
|
||||||
"ruff",
|
"ruff",
|
||||||
"jdtls",
|
"jdtls",
|
||||||
"nil_ls",
|
"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()
|
require("copilot").setup()
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,20 @@ return {
|
||||||
-- LSP Stuff
|
-- LSP Stuff
|
||||||
-- TODO: make these lang specific
|
-- TODO: make these lang specific
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"mason/mason.nvim",
|
||||||
-- opts = overrides.mason
|
-- opts = overrides.mason
|
||||||
opts = {
|
opts = {
|
||||||
PATH = "append",
|
PATH = "append",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
opts = {},
|
||||||
|
dependencies = {
|
||||||
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"cbochs/grapple.nvim",
|
"cbochs/grapple.nvim",
|
||||||
|
|
@ -50,7 +58,6 @@ return {
|
||||||
end, -- Override to setup mason-lspconfig
|
end, -- Override to setup mason-lspconfig
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvimdev/lspsaga.nvim",
|
"nvimdev/lspsaga.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue