fix: java dap

This commit is contained in:
asep.komarudin 2024-06-23 17:15:58 +07:00
parent cecf29d7db
commit ddfa140e41

View file

@ -58,31 +58,31 @@ if pcode.active_java_config.active then
}, },
config = function() config = function()
require("user.dapui") require("user.dapui")
local dap = require("dap") -- local dap = require("dap")
local util = require("jdtls.util") -- local util = require("jdtls.util")
dap.adapters.java = function(callback) -- dap.adapters.java = function(callback)
util.execute_command({ command = "vscode.java.startDebugSession" }, function(err0, port) -- util.execute_command({ command = "vscode.java.startDebugSession" }, function(err0, port)
if err0 ~= nil then -- if err0 ~= nil then
return -- return
end -- end
callback({ type = "server", host = "127.0.0.1", port = port }) -- callback({ type = "server", host = "127.0.0.1", port = port })
end) -- end)
end -- end
dap.configurations.java = { -- dap.configurations.java = {
{ -- {
type = "java", -- type = "java",
request = "launch", -- request = "launch",
name = "Debug Java", -- name = "Debug Java",
program = "${file}", -- program = "${file}",
args = {}, -- args = {},
cwd = vim.fn.getcwd(), -- cwd = vim.fn.getcwd(),
stopOnEntry = false, -- stopOnEntry = false,
console = "integratedTerminal", -- console = "integratedTerminal",
internalConsoleOptions = "neverOpen", -- internalConsoleOptions = "neverOpen",
sourceMaps = true, -- sourceMaps = true,
outDir = "${workspaceFolder}/out", -- outDir = "${workspaceFolder}/out",
}, -- },
} -- }
end, end,
keys = { keys = {
{ "<leader>d", "", desc = "  Debug" }, { "<leader>d", "", desc = "  Debug" },