dotfiles/home/.config/nvim/lua/plugins/mason.lua

36 lines
1,001 B
Lua
Raw Normal View History

-- Package manager for LSP servers, DAP adapters etc.
-- It also handles starting all of my LSP servers
2023-11-25 14:37:36 +02:00
--- @type LazyPluginSpec
return {
"williamboman/mason.nvim",
dependencies = {
"neovim/nvim-lspconfig",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
-- Extended functionality for jdtls
"mfussenegger/nvim-jdtls",
2023-11-25 13:24:48 +02:00
-- Add support for LSP file operations
{ "antosha417/nvim-lsp-file-operations", config = true },
},
config = function()
require("mason").setup()
local mlspc = require("mason-lspconfig")
local lsp_utils = require("lsp_utils")
mlspc.setup()
mlspc.setup_handlers({
-- Default handler
function(server_name)
require("lspconfig")[server_name].setup({
on_attach = lsp_utils.map_keys,
2023-11-25 13:32:42 +02:00
capabilities = lsp_utils.get_capabilities(),
})
end,
-- Don't set up jdtls, it is set up by nvim-jdtls
["jdtls"] = function() end,
})
end,
}