This repository was archived by the owner on Nov 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function M.get_config(opts)
3131 local jdtls_config = path .join (jdtls_root , ' config' )
3232 local lombok_path = path .join (lombok_root , ' lombok.jar' )
3333 local equinox_launcher =
34- path .join (jdtls_root , ' plugins' , ' org.eclipse.equinox.launcher.jar' )
34+ path .join (jdtls_root , ' plugins' , ' org.eclipse.equinox.launcher.jar' )
3535 local plugin_paths = plugins .get_plugin_paths (opts .jdtls_plugins )
3636 local base_config = config .get_config ()
3737
@@ -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 (vim . fn . expand ( ' $MASON/packages/openjdk-17 /jdk-17*' ))
7474 local java_bin = path .join (java_home , ' /bin' )
7575
7676 base_config .cmd_env = {
@@ -108,9 +108,9 @@ function M.get_root_finder(root_markers)
108108 local fallback_dir = vim .fn .getcwd ()
109109 log .debug (
110110 " couldn't find root of "
111- .. file_name
112- .. ' using fallback dir '
113- .. fallback_dir
111+ .. file_name
112+ .. ' using fallback dir '
113+ .. fallback_dir
114114 )
115115 return fallback_dir
116116 end
Original file line number Diff line number Diff line change @@ -6,21 +6,25 @@ 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 mason_data_path = vim .fn .stdpath (" data" ) .. " /mason/packages/" .. pkg_name
10+ return mason_data_path
1011end
1112
12- --- Returns true if the package in installed in mason
13+ --- Returns true if the package is installed in mason
1314--- @param pkg_name string
1415--- @return boolean
1516function M .is_pkg_installed (pkg_name )
16- return mason_registry .get_package (pkg_name ):is_installed ()
17+ local ok , pkg = pcall (mason_registry .get_package , pkg_name )
18+ return ok and pkg :is_installed ()
1719end
1820
1921--- Returns the shared artifact path for a given package
20- --- @param pkg_name string name of the package to get the path of
21- --- @return string # path to the shared artifact directory of the package
22+ --- @param pkg_name string
23+ --- @return string
2224function M .get_shared_path (pkg_name )
23- return vim .fn .glob (' $MASON/share/' .. pkg_name )
25+ local mason_share_path = vim .fn .stdpath (" data" ) .. " /mason/share/" .. pkg_name
26+ return mason_share_path
2427end
2528
2629return M
30+
You can’t perform that action at this time.
0 commit comments