FEAT: Added Debugger Adapter Protocol
Paths are setup for my main Windows machine Linux can be defined when necessary
This commit is contained in:
24
after/ftplugin/java.lua
Normal file
24
after/ftplugin/java.lua
Normal file
@ -0,0 +1,24 @@
|
||||
--[[
|
||||
-- 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()
|
Reference in New Issue
Block a user