Skip to content

Commit ff21038

Browse files
committed
chore(advanced_lsp): remove usage of get_install_path
1 parent 184ec8c commit ff21038

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/content/docs/recipes/advanced_lsp.mdx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -713,19 +713,8 @@ return {
713713
.. project_name
714714
os.execute("mkdir " .. workspace_dir)
715715

716-
-- get the mason install path
717-
local install_path =
718-
require("mason-registry").get_package("jdtls"):get_install_path()
719-
720-
-- get the current OS
721-
local os
722-
if vim.fn.has("macunix") then
723-
os = "mac"
724-
elseif vim.fn.has("win32") then
725-
os = "win"
726-
else
727-
os = "linux"
728-
end
716+
-- get the mason jdtls path
717+
local jdtls_files = vim.fn.expand("$MASON/share/jdtls")
729718

730719
-- return the server config
731720
return {
@@ -736,19 +725,17 @@ return {
736725
"-Declipse.product=org.eclipse.jdt.ls.core.product",
737726
"-Dlog.protocol=true",
738727
"-Dlog.level=ALL",
739-
"-javaagent:" .. install_path .. "/lombok.jar",
728+
"-javaagent:" .. jdtls_files .. "/lombok.jar",
740729
"-Xms1g",
741730
"--add-modules=ALL-SYSTEM",
742731
"--add-opens",
743732
"java.base/java.util=ALL-UNNAMED",
744733
"--add-opens",
745734
"java.base/java.lang=ALL-UNNAMED",
746735
"-jar",
747-
vim.fn.glob(
748-
install_path .. "/plugins/org.eclipse.equinox.launcher_*.jar"
749-
),
736+
jdtls_files .. "/plugins/org.eclipse.equinox.launcher.jar",
750737
"-configuration",
751-
install_path .. "/config_" .. os,
738+
jdtls_files .. "/config",
752739
"-data",
753740
workspace_dir,
754741
},

0 commit comments

Comments
 (0)