File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function M.get_config(opts)
7070
7171 if jdk :is_installed () then
7272 local java_home =
73- vim .fn .glob (path . join ( jdk : get_install_path (), ' / jdk-17*' ) )
73+ vim .fn .glob (' $MASON/packages/ jdk-17*' )
7474 local java_bin = path .join (java_home , ' /bin' )
7575
7676 base_config .cmd_env = {
Original file line number Diff line number Diff line change @@ -6,14 +6,19 @@ local M = {}
66--- @param pkg_name string
77--- @return string | nil
88function M .get_pkg_path (pkg_name )
9- return mason_registry .get_package (pkg_name ):get_install_path ()
9+ local found , pkg = pcall (mason_registry .get_package , pkg_name )
10+ if not found or not pkg :is_installed () then
11+ return nil
12+ end
13+ return vim .fn .expand (" $MASON/packages/" .. pkg_name )
1014end
1115
12- --- Returns true if the package in installed in mason
16+ --- Returns true if the package is installed in mason
1317--- @param pkg_name string
1418--- @return boolean
1519function M .is_pkg_installed (pkg_name )
16- return mason_registry .get_package (pkg_name ):is_installed ()
20+ local found , pkg = pcall (mason_registry .get_package , pkg_name )
21+ return found and pkg :is_installed ()
1722end
1823
1924--- Returns the shared artifact path for a given package
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ require('lazy').setup({
2525 lazy = false ,
2626 },
2727 {
28- ' williamboman /mason.nvim' ,
28+ ' mason-org /mason.nvim' ,
2929 lazy = false ,
3030 },
3131}, {
You can’t perform that action at this time.
0 commit comments