mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Fixed jdtls bin path for a proper lsp initialization
This commit is contained in:
parent
ec5981dfb1
commit
2e11021a8b
1 changed files with 4 additions and 1 deletions
|
|
@ -85,10 +85,13 @@ return {
|
||||||
dependencies = { "folke/which-key.nvim" },
|
dependencies = { "folke/which-key.nvim" },
|
||||||
ft = java_filetypes,
|
ft = java_filetypes,
|
||||||
opts = function()
|
opts = function()
|
||||||
local cmd = { vim.fn.exepath("jdtls") }
|
local cmd = { vim.fn.exepath("jdtls") } -- Can be empty if executed too early
|
||||||
if LazyVim.has("mason.nvim") then
|
if LazyVim.has("mason.nvim") then
|
||||||
local mason_registry = require("mason-registry")
|
local mason_registry = require("mason-registry")
|
||||||
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
||||||
|
|
||||||
|
-- Should be re-executed after require("mason-registry") to get a real value
|
||||||
|
cmd = { vim.fn.exepath("jdtls") }
|
||||||
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
|
table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar))
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue