From 6c17812e11b59e4dc473462ad430649f621b0dce Mon Sep 17 00:00:00 2001 From: Hawtian Wang Date: Fri, 26 Apr 2024 17:33:27 +0800 Subject: [PATCH] ... --- lua/dotvim/pkgs/base/plugins/mason.lua | 2 +- lua/dotvim/utils/init.lua | 55 +++++++++++++------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/lua/dotvim/pkgs/base/plugins/mason.lua b/lua/dotvim/pkgs/base/plugins/mason.lua index d13b9f80..64f7f6a0 100644 --- a/lua/dotvim/pkgs/base/plugins/mason.lua +++ b/lua/dotvim/pkgs/base/plugins/mason.lua @@ -2,7 +2,7 @@ return { "williamboman/mason.nvim", opts = { - PATH = "skip", + PATH = "append", ui = { icons = { package_installed = " ", diff --git a/lua/dotvim/utils/init.lua b/lua/dotvim/utils/init.lua index 0b7f4a84..2d5f78e1 100644 --- a/lua/dotvim/utils/init.lua +++ b/lua/dotvim/utils/init.lua @@ -51,33 +51,34 @@ end ---@param name string ---@return string function M.which(name) - if type(name) ~= "string" then - return name - end - - return which_cache:ensure({ "bin", name }, function() - if M.nix.is_nix_managed() then - local ret = M.nix.resolve_bin(name) - if ret ~= nil then - return ret - end - end - - -- nixos should not try to resolve binaries from mason - if M.nix.is_nixos() then - return name - end - - if M.lazy.has("mason.nvim") then - local mason_root = require("mason.settings").current.install_root_dir - local path = mason_root .. "/bin/" .. name - if vim.fn.executable(path) == 1 then - return path - end - end - - return name - end) + return name + -- if type(name) ~= "string" then + -- return name + -- end + -- + -- return which_cache:ensure({ "bin", name }, function() + -- if M.nix.is_nix_managed() then + -- local ret = M.nix.resolve_bin(name) + -- if ret ~= nil then + -- return ret + -- end + -- end + -- + -- -- nixos should not try to resolve binaries from mason + -- if M.nix.is_nixos() then + -- return name + -- end + -- + -- if M.lazy.has("mason.nvim") then + -- local mason_root = require("mason.settings").current.install_root_dir + -- local path = mason_root .. "/bin/" .. name + -- if vim.fn.executable(path) == 1 then + -- return path + -- end + -- end + -- + -- return name + -- end) end ---NOTE: opts will be modified in place