use mason for dependency management

This commit is contained in:
sgraves committed 2026-08-09 12:18:18 -05:00
1 parent b993db8ee6
commit 53d06709b2
7 files changed
+75 -44

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
-- The MIT License (MIT)
--
-- Copyright © 2026 Scott E. Graves <scott.e.graves@protonmail.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
-- and associated documentation files (the “Software”), to deal in the Software without restriction,
-- including without limitation the rights to use, copy, modify, merge, publish, distribute,
-- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all copies or
-- substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
-- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
local symbols = require("darcula.utils.symbols")
require("mason").setup {
install_root_dir = NV_DARCULA_MASON_ROOT,
PATH = "prepend",
ui = {
border = "rounded",
icons = {
package_installed = symbols.status.ok,
package_pending = symbols.status.checking,
package_uninstalled = symbols.status.uninstalled
}
}
}
local ensure_installed = vim.deepcopy(NV_DARCULA_MASON_INST_LIST)
vim.list_extend(ensure_installed, NV_DARCULA_MASON_TOOL_LIST)
local installer = require("mason-tool-installer")
installer.setup {
ensure_installed = ensure_installed,
integrations = {
["mason-lspconfig"] = true,
["mason-null-ls"] = false,
["mason-nvim-dap"] = false
},
run_on_start = false
}
installer.check_install(false, true)
+2 -26
View File
@@ -21,29 +21,11 @@ if NV_DARCULA_ENABLE_COC then
return
end
local symbols = require("darcula.utils.symbols")
---@diagnostic disable-next-line: deprecated
local unpacker = table.unpack or unpack
require("mason").setup {
ui = {
border = "rounded",
icons = {
package_installed = symbols.status.ok,
package_pending = symbols.status.checking,
package_uninstalled = symbols.status.uninstalled
}
}
}
require("mason-lspconfig").setup {
automatic_enable = NV_DARCULA_MASON_LSP_LIST,
ensure_installed = NV_DARCULA_MASON_INST_LIST
}
require("mason-tool-installer").setup {
ensure_installed = NV_DARCULA_MASON_TOOL_LIST,
run_on_start = true
automatic_enable = NV_DARCULA_MASON_LSP_LIST
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -83,13 +65,7 @@ for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
)
elseif name == "jdtls" then
local lombok =
vim.fs.joinpath(
vim.fn.stdpath("data"),
"mason",
"packages",
"jdtls",
"lombok.jar"
)
vim.fs.joinpath(NV_DARCULA_MASON_ROOT, "packages", "jdtls", "lombok.jar")
vim.env.JDTLS_JVM_ARGS =
table.concat(
{