Updated mason
This commit is contained in:
@@ -23,6 +23,7 @@ return {
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
automatic_enable = false,
|
||||
ensure_installed = {
|
||||
"ts_ls",
|
||||
"html",
|
||||
|
||||
@@ -107,27 +107,20 @@ return {
|
||||
local registry = require("mason-registry")
|
||||
registry.refresh()
|
||||
local installed_packages = registry.get_installed_package_names()
|
||||
local upgrades_available = false
|
||||
|
||||
local packages_outdated = 0
|
||||
local function myCallback(success, _)
|
||||
if success then
|
||||
upgrades_available = true
|
||||
|
||||
for _, pkg in pairs(installed_packages) do
|
||||
local p = registry.get_package(pkg)
|
||||
local version = p.get_installed_version(p)
|
||||
local latest = p.get_latest_version(p)
|
||||
|
||||
if version ~= latest then
|
||||
packages_outdated = packages_outdated + 1
|
||||
end
|
||||
end
|
||||
|
||||
for _, pkg in pairs(installed_packages) do
|
||||
local p = registry.get_package(pkg)
|
||||
if p then
|
||||
p:check_new_version(myCallback)
|
||||
end
|
||||
end
|
||||
|
||||
if upgrades_available then
|
||||
return packages_outdated
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local function show_macro_recording()
|
||||
@@ -176,7 +169,7 @@ return {
|
||||
icon = "",
|
||||
color = { fg = colors.violet, bg = "None", gui = "bold" },
|
||||
on_click = function()
|
||||
vim.cmd("Neogit")
|
||||
vim.cmd("LazyGit")
|
||||
end,
|
||||
}
|
||||
local lsp_status = {
|
||||
|
||||
Reference in New Issue
Block a user