Files
darcula_nvim/nvim/lua/darcula/setup/100_mason.lua
2026-03-31 12:07:49 -05:00

106 lines
3.1 KiB
Lua

-- 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.
--
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
}
vim.lsp.config(
"*",
{
capabilities = require("mini.completion").get_lsp_capabilities()
}
)
for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
if name == "clangd" then
vim.lsp.config(
"clangd",
{
cmd = {
"clangd",
unpacker(NV_DARCULA_CLANGD_ARGS)
}
}
)
elseif name == "lua_ls" then
vim.lsp.config(
name,
{
settings = {
Lua = {
completion = {
callSnippet = "Both",
keywordSnippet = "Both"
},
diagnostics = {globals = NV_DARCULA_LUA_GLOBALS},
runtime = {
version = "LuaJIT"
},
telemetry = {enable = false},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
vim.fn.stdpath("config")
-- vim.fs.joinpath(
-- vim.fn.stdpath("data"),
-- "site",
-- "pack",
-- "core",
-- "opt"
-- )
}
-- maxPreload = 1000,
-- preloadFileSize = 200
}
}
}
}
)
else
vim.lsp.config(name, {})
end
end