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-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()
|
|
|
|
|
|
|
|
local mason_lsp = 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
|
|
|
local capabilities = lsp_utils.get_capabilities()
|
|
|
|
mason_lsp.setup()
|
|
|
|
|
|
|
|
mason_lsp.setup_handlers({
|
|
|
|
-- Default handler
|
|
|
|
function(server_name)
|
|
|
|
require("lspconfig")[server_name].setup({
|
|
|
|
on_attach = lsp_utils.on_attach,
|
|
|
|
capabilities = capabilities,
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
|
|
|
|
-- Don't set up jdtls, it is set up by nvim-jdtls
|
|
|
|
["jdtls"] = function() end,
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
}
|