File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,7 @@ function M.get_config(opts)
69
69
local jdk = mason_reg .get_package (' openjdk-17' )
70
70
71
71
if jdk :is_installed () then
72
- local java_home =
73
- vim .fn .glob (path .join (jdk :get_install_path (), ' /jdk-17*' ))
72
+ local java_home = vim .fn .glob (' $MASON/packages/jdk-17*' )
74
73
local java_bin = path .join (java_home , ' /bin' )
75
74
76
75
base_config .cmd_env = {
Original file line number Diff line number Diff line change @@ -6,14 +6,19 @@ local M = {}
6
6
--- @param pkg_name string
7
7
--- @return string | nil
8
8
function 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 )
10
14
end
11
15
12
- --- Returns true if the package in installed in mason
16
+ --- Returns true if the package is installed in mason
13
17
--- @param pkg_name string
14
18
--- @return boolean
15
19
function 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 ()
17
22
end
18
23
19
24
--- 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({
25
25
lazy = false ,
26
26
},
27
27
{
28
- ' williamboman /mason.nvim' ,
28
+ ' mason-org /mason.nvim' ,
29
29
lazy = false ,
30
30
},
31
31
}, {
You can’t perform that action at this time.
0 commit comments