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