aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/registry/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-04-22 22:35:14 +0200
committerGitHub <noreply@github.com>2023-04-22 22:35:14 +0200
commit54c9176cb82fe1c227978c6df2e2b29f985cbd02 (patch)
treee329148d6211513feec0e02ef8610883f55a9e0f /lua/mason-core/installer/registry/init.lua
parentfeat(registry): add .get_all_package_specs() (#1247) (diff)
downloadmason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar.gz
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar.bz2
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar.lz
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar.xz
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.tar.zst
mason-54c9176cb82fe1c227978c6df2e2b29f985cbd02.zip
refactor(schemas): don't vendor schemas in mason.nvim (#1248)
Instead, schemas are now defined in the package registry and downloaded during installation. See https://github.com/mason-org/mason-registry/pull/1319.
Diffstat (limited to 'lua/mason-core/installer/registry/init.lua')
-rw-r--r--lua/mason-core/installer/registry/init.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/mason-core/installer/registry/init.lua b/lua/mason-core/installer/registry/init.lua
index 6c22d227..f5655572 100644
--- a/lua/mason-core/installer/registry/init.lua
+++ b/lua/mason-core/installer/registry/init.lua
@@ -5,6 +5,7 @@ local _ = require "mason-core.functional"
local a = require "mason-core.async"
local link = require "mason-core.installer.registry.link"
local log = require "mason-core.log"
+local schemas = require "mason-core.installer.registry.schemas"
local M = {}
@@ -170,6 +171,16 @@ function M.compile(spec, opts)
-- Run installer
try(parsed.provider.install(ctx, parsed.source, parsed.purl))
+ if spec.schemas then
+ local result = schemas.download(ctx, spec, parsed.purl, parsed.source):on_failure(function(err)
+ log.error("Failed to download schemas", ctx.package, err)
+ end)
+ if opts.strict then
+ -- schema download sources are not considered stable nor a critical feature, so we only fail in strict mode
+ try(result)
+ end
+ end
+
-- Expand & register links
if spec.bin then
try(link.bin(ctx, spec, parsed.purl, parsed.source))