mirror of
https://github.com/itme-brain/nvim.git
synced 2026-05-08 15:10:13 -04:00
updated
This commit is contained in:
parent
17bf7e4973
commit
7d72471237
17 changed files with 297 additions and 538 deletions
|
|
@ -11,10 +11,6 @@ return {
|
|||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
},
|
||||
cmd = {
|
||||
"DapContinue",
|
||||
|
|
@ -41,15 +37,41 @@ return {
|
|||
{ "<leader>dO", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||
{ "<leader>du", function() require("dapui").toggle() end, desc = "Toggle Debug UI" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, mode = { "n", "v" }, desc = "Evaluate" },
|
||||
{ "<leader>ds", function() require("telescope").extensions.dap.configurations() end, desc = "Debug Configurations" },
|
||||
{ "<leader>dS", function() require("telescope").extensions.dap.list_breakpoints() end, desc = "Debug Breakpoints" },
|
||||
{ "<leader>de", function() require("dap.ui.widgets").hover() end, mode = { "n", "v" }, desc = "Evaluate" },
|
||||
{ "<leader>du",
|
||||
function()
|
||||
local widgets = require("dap.ui.widgets")
|
||||
widgets.centered_float(widgets.scopes)
|
||||
end,
|
||||
desc = "Show Scopes" },
|
||||
{ "<leader>df",
|
||||
function()
|
||||
local widgets = require("dap.ui.widgets")
|
||||
widgets.centered_float(widgets.frames)
|
||||
end,
|
||||
desc = "Call Stack" },
|
||||
{ "<leader>ds",
|
||||
function()
|
||||
local dap = require("dap")
|
||||
local ft = vim.bo.filetype
|
||||
local configs = dap.configurations[ft] or {}
|
||||
if #configs == 0 then
|
||||
vim.notify("No DAP configurations for filetype: " .. ft, vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
vim.ui.select(configs, {
|
||||
prompt = "Select DAP configuration:",
|
||||
format_item = function(c) return c.name end,
|
||||
}, function(choice)
|
||||
if choice then dap.run(choice) end
|
||||
end)
|
||||
end,
|
||||
desc = "Debug Configurations" },
|
||||
{ "<leader>dS", function() require("dap").list_breakpoints() end, desc = "List Breakpoints" },
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-nvim-dap").setup({
|
||||
|
|
@ -58,52 +80,12 @@ return {
|
|||
handlers = {},
|
||||
})
|
||||
|
||||
require("nvim-dap-virtual-text").setup({
|
||||
commented = true,
|
||||
})
|
||||
|
||||
dapui.setup({
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = "scopes", size = 0.45 },
|
||||
{ id = "breakpoints", size = 0.15 },
|
||||
{ id = "stacks", size = 0.25 },
|
||||
{ id = "watches", size = 0.15 },
|
||||
},
|
||||
position = "right",
|
||||
size = 50,
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{ id = "repl", size = 0.5 },
|
||||
{ id = "console", size = 0.5 },
|
||||
},
|
||||
position = "bottom",
|
||||
size = 10,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "B", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DapBreakpointCondition", { text = "C", texthl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DapLogPoint", { text = "L", texthl = "DiagnosticSignInfo" })
|
||||
vim.fn.sign_define("DapStopped", { text = ">", texthl = "DiagnosticSignWarn", linehl = "Visual" })
|
||||
vim.fn.sign_define("DapBreakpointRejected", { text = "R", texthl = "DiagnosticSignError" })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.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
|
||||
|
||||
dap.adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
|
|
@ -136,10 +118,6 @@ return {
|
|||
dap.configurations.typescript = js_configurations
|
||||
dap.configurations.javascriptreact = js_configurations
|
||||
dap.configurations.typescriptreact = js_configurations
|
||||
|
||||
pcall(function()
|
||||
require("telescope").load_extension("dap")
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue