feat(astro): added support for ts-plugin, but won't work till mason-registry PR is merged. See #3364

This commit is contained in:
Folke Lemaitre 2024-06-01 08:33:24 +02:00
parent 9d999fa210
commit 683aaeb75b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 27 additions and 2 deletions

View file

@ -221,10 +221,13 @@ end
--- available yet and trigger errors.
---@param pkg string
---@param path? string
function M.get_pkg_path(pkg, path)
---@param opts? { warn?: boolean }
function M.get_pkg_path(pkg, path, opts)
opts = opts or {}
opts.warn = opts.warn == nil and true or opts.warn
path = path or ""
local ret = vim.env.MASON .. "/packages/" .. pkg .. "/" .. path
if not vim.loop.fs_stat(ret) then
if opts.warn and not vim.loop.fs_stat(ret) then
M.warn(("Mason package path not found for **%s**:\n- `%s`"):format(pkg, path))
end
return ret