mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-13 19:04:36 +02:00
Improve path joining in LazyVim.get_pkg_path
This commit is contained in:
parent
060b7ca704
commit
65306ceff4
2 changed files with 12 additions and 5 deletions
|
@ -50,7 +50,7 @@ return {
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
dap.adapters.php = {
|
dap.adapters.php = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = vim.fn.exepath("php-debug-adapter"),
|
command = "php-debug-adapter",
|
||||||
args = {},
|
args = {},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -254,10 +254,17 @@ function M.get_pkg_path(pkg, path, opts)
|
||||||
opts.warn = opts.warn == nil and true or opts.warn
|
opts.warn = opts.warn == nil and true or opts.warn
|
||||||
path = path or ""
|
path = path or ""
|
||||||
local ret = vim.fs.normalize(root .. "/packages/" .. pkg .. "/" .. path)
|
local ret = vim.fs.normalize(root .. "/packages/" .. pkg .. "/" .. path)
|
||||||
if opts.warn and not vim.loop.fs_stat(ret) and not require("lazy.core.config").headless() then
|
if opts.warn then
|
||||||
M.warn(
|
vim.schedule(function()
|
||||||
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path)
|
if not require("lazy.core.config").headless() and not vim.loop.fs_stat(ret) then
|
||||||
)
|
M.warn(
|
||||||
|
("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(
|
||||||
|
pkg,
|
||||||
|
path
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue