|
|
|
@ -14,12 +14,13 @@ end
|
|
|
|
|
return {
|
|
|
|
|
{
|
|
|
|
|
"jayp0521/mason-nvim-dap.nvim",
|
|
|
|
|
lazy = false,
|
|
|
|
|
config = function()
|
|
|
|
|
local dap = require("dap")
|
|
|
|
|
local mason_dap = require("mason-nvim-dap")
|
|
|
|
|
|
|
|
|
|
mason_dap.setup({
|
|
|
|
|
ensure_installed = { "python", "codelldb" },
|
|
|
|
|
ensure_installed = { "python", "codelldb", "java-debug-adapter", "java-test" },
|
|
|
|
|
automatic_setup = true,
|
|
|
|
|
})
|
|
|
|
|
mason_dap.setup_handlers({
|
|
|
|
@ -67,69 +68,70 @@ return {
|
|
|
|
|
-- apply suggestions from catppuccin theme
|
|
|
|
|
local sign = vim.fn.sign_define
|
|
|
|
|
|
|
|
|
|
sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" })
|
|
|
|
|
sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "DapBreakpointLinehl", numhl = "" })
|
|
|
|
|
sign("DapStopped", { text = "", texthl = "Error", linehl = "DapStoppedLinehl", numhl = "" })
|
|
|
|
|
sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" })
|
|
|
|
|
sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" })
|
|
|
|
|
end,
|
|
|
|
|
-- stylua: ignore
|
|
|
|
|
keys = {
|
|
|
|
|
{ "<leader>bb", vim.cmd.DapToggleBreakpoint, desc = "Toggle Breakpoint" },
|
|
|
|
|
{
|
|
|
|
|
"<leader>bf",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").list_breakpoints()
|
|
|
|
|
end,
|
|
|
|
|
desc = "List Breakpoints",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"<leader>bc",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").clear_breakpoints()
|
|
|
|
|
end,
|
|
|
|
|
desc = "Clear Breakpoints",
|
|
|
|
|
},
|
|
|
|
|
{ "<leader>bf", function() require("dap").list_breakpoints() end, desc = "List Breakpoints", },
|
|
|
|
|
{ "<leader>bc", function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints", },
|
|
|
|
|
|
|
|
|
|
{ "<leader>dc", vim.cmd.DapContinue, desc = "Start / Continue" },
|
|
|
|
|
{
|
|
|
|
|
"<leader>dj",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").step_over()
|
|
|
|
|
end,
|
|
|
|
|
desc = "Step Over",
|
|
|
|
|
{ "<leader>dj", function() require("dap").step_over() end, desc = "Step Over", },
|
|
|
|
|
{ "<leader>dk", function() require("dap").step_into() end, desc = "Step Into", },
|
|
|
|
|
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out", },
|
|
|
|
|
{ "<leader>dd", function() require("dap").disconnect() end, desc = "Disconnect", },
|
|
|
|
|
{ "<leader>dr", function() require("dap").restart() end, desc = "Restart", },
|
|
|
|
|
|
|
|
|
|
{ "<leader>du", function() require("dapui").toggle({}) end, desc = "Toggle UI", },
|
|
|
|
|
{ "<leader>dt", function() require("dap.repl").toggle() end, desc = "Toggle REPL", },
|
|
|
|
|
},
|
|
|
|
|
dependencies = {
|
|
|
|
|
"williamboman/mason.nvim",
|
|
|
|
|
{
|
|
|
|
|
"<leader>dk",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").step_into()
|
|
|
|
|
"mfussenegger/nvim-dap",
|
|
|
|
|
config = function()
|
|
|
|
|
local dap, dapui = require("dap"), require("dapui")
|
|
|
|
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
|
|
|
|
dapui.open()
|
|
|
|
|
end
|
|
|
|
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
|
|
|
|
dapui.close()
|
|
|
|
|
end
|
|
|
|
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
|
|
|
|
dapui.close()
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
desc = "Step Into",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"<leader>do",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").step_out()
|
|
|
|
|
end,
|
|
|
|
|
desc = "Step Out",
|
|
|
|
|
},
|
|
|
|
|
"rcarriga/nvim-dap-ui",
|
|
|
|
|
opts = {
|
|
|
|
|
-- stylua: ignore
|
|
|
|
|
layouts = {
|
|
|
|
|
{
|
|
|
|
|
"<leader>dd",
|
|
|
|
|
function()
|
|
|
|
|
require("dap").disconnect()
|
|
|
|
|
end,
|
|
|
|
|
desc = "Disconnect",
|
|
|
|
|
elements = {
|
|
|
|
|
{ id = "stacks", size = 0.15, },
|
|
|
|
|
{ id = "repl", size = 0.05, },
|
|
|
|
|
{ id = "scopes", size = 0.40, },
|
|
|
|
|
-- { id = "breakpoints", size = 0.25, },
|
|
|
|
|
{ id = "watches", size = 0.40, },
|
|
|
|
|
},
|
|
|
|
|
position = "left",
|
|
|
|
|
size = 40,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"<leader>du",
|
|
|
|
|
function()
|
|
|
|
|
require("dapui").toggle({})
|
|
|
|
|
end,
|
|
|
|
|
desc = "Toggle UI",
|
|
|
|
|
elements = {
|
|
|
|
|
{ id = "console", size = 1, },
|
|
|
|
|
},
|
|
|
|
|
position = "bottom",
|
|
|
|
|
size = 10,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
dependencies = {
|
|
|
|
|
"williamboman/mason.nvim",
|
|
|
|
|
"mfussenegger/nvim-dap",
|
|
|
|
|
{ "rcarriga/nvim-dap-ui", config = true },
|
|
|
|
|
{ "theHamsta/nvim-dap-virtual-text", config = true },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|