fix(jdtls): root_dir

This commit is contained in:
Folke Lemaitre 2025-09-15 20:44:14 +02:00
parent 23b9cdeb34
commit 271fecb067
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -91,7 +91,6 @@ return {
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 {
root_dir = vim.fs.root(0, vim.lsp.config.jdtls.root_markers),
-- How to find the project name for a given root dir. -- How to find the project name for a given root dir.
project_name = function(root_dir) project_name = function(root_dir)
@ -165,12 +164,10 @@ return {
end end
end end
local function attach_jdtls() local function attach_jdtls()
local fname = vim.api.nvim_buf_get_name(0)
-- Configuration can be augmented and overridden by opts.jdtls -- Configuration can be augmented and overridden by opts.jdtls
local config = extend_or_override({ local config = extend_or_override({
cmd = opts.full_cmd(opts), cmd = opts.full_cmd(opts),
root_dir = opts.root_dir(fname), root_dir = vim.fs.root(0, vim.lsp.config.jdtls.root_markers),
init_options = { init_options = {
bundles = bundles, bundles = bundles,
}, },