mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-24 21:41:08 +00:00
fix(jdtls): allow config jdtls bundles from user's both opts.init_options.bundles and opts.jdtls.init_options.bundles
This commit is contained in:
parent
f03d5016fc
commit
2c68ad40ca
1 changed files with 10 additions and 6 deletions
|
|
@ -147,12 +147,6 @@ return {
|
||||||
-- Find the extra bundles that should be passed on the jdtls command-line
|
-- Find the extra bundles that should be passed on the jdtls command-line
|
||||||
-- if nvim-dap is enabled with java debug/test.
|
-- if nvim-dap is enabled with java debug/test.
|
||||||
local bundles = {} ---@type string[]
|
local bundles = {} ---@type string[]
|
||||||
|
|
||||||
-- Allow users to add custom bundles through opts.init_options.bundles
|
|
||||||
if opts.init_options and opts.init_options.bundles then
|
|
||||||
vim.list_extend(bundles, opts.init_options.bundles)
|
|
||||||
end
|
|
||||||
|
|
||||||
if LazyVim.has("mason.nvim") then
|
if LazyVim.has("mason.nvim") then
|
||||||
local mason_registry = require("mason-registry")
|
local mason_registry = require("mason-registry")
|
||||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||||
|
|
@ -163,6 +157,16 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Allow users to add custom bundles through opts.init_options.bundles and opts.jdtls.bundles
|
||||||
|
if opts.init_options and opts.init_options.bundles then
|
||||||
|
vim.list_extend(bundles, opts.init_options.bundles)
|
||||||
|
end
|
||||||
|
if opts.jdtls and opts.jdtls.init_options and opts.jdtls.init_options.bundles then
|
||||||
|
vim.list_extend(bundles, opts.jdtls.init_options.bundles)
|
||||||
|
opts.jdtls.init_options.bundles = nil
|
||||||
|
end
|
||||||
|
|
||||||
local function attach_jdtls()
|
local function attach_jdtls()
|
||||||
local fname = vim.api.nvim_buf_get_name(0)
|
local fname = vim.api.nvim_buf_get_name(0)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue