From 65306ceff474c407d472e8950e481e96e6c05f68 Mon Sep 17 00:00:00 2001 From: TheDSCPL Date: Wed, 14 May 2025 02:32:25 +0000 Subject: [PATCH] Improve path joining in LazyVim.get_pkg_path --- lua/lazyvim/plugins/extras/lang/php.lua | 2 +- lua/lazyvim/util/init.lua | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index c7827b88..04469223 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -50,7 +50,7 @@ return { local dap = require("dap") dap.adapters.php = { type = "executable", - command = vim.fn.exepath("php-debug-adapter"), + command = "php-debug-adapter", args = {}, } end, diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index d6731e2b..339fdadb 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -254,10 +254,17 @@ function M.get_pkg_path(pkg, path, opts) opts.warn = opts.warn == nil and true or opts.warn path = path or "" 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 - M.warn( - ("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path) - ) + if opts.warn then + vim.schedule(function() + 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 return ret end