1
0
neovim_config/after/ftplugin/java.lua

25 lines
816 B
Lua
Raw Normal View History

--[[
-- Only setup for windows
-- Don't know if all this is actually necessary
-- TODO: FIX: Clean this mess up ~ 03/28/2024
--]]
if vim.loop.os_uname().sysname == 'Windows_NT' then
Cmd = 'c:/Users/nigel/Appdata/Local/nvim-data/mason/bin/jdtls.cmd'
JavaDebug = vim.fn.glob("C:/Users/nigel/AppData/Local/nvim-data/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-0.52.0.jar", 1)
else
Cmd = ''
JavaDebug = nil
end
local config = {
cmd = {Cmd},
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
init_options = {
bundles = {
JavaDebug
}
}
}
require('jdtls').start_or_attach(config)
require('jdtls').setup_dap({hotcodreplace='auto'})
require('jdtls.dap').setup_dap_main_class_configs()