2024-03-28 20:45:53 +00:00
|
|
|
return {
|
|
|
|
{
|
|
|
|
'mfussenegger/nvim-dap',
|
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
'rcarriga/nvim-dap-ui',
|
|
|
|
dependencies = {
|
|
|
|
'mfussenegger/nvim-dap',
|
|
|
|
'nvim-neotest/nvim-nio',
|
|
|
|
},
|
|
|
|
config = function ()
|
|
|
|
require("dapui").setup()
|
|
|
|
end
|
|
|
|
},
|
2024-03-31 20:30:23 +00:00
|
|
|
{
|
|
|
|
'theHamsta/nvim-dap-virtual-text',
|
|
|
|
config = function()
|
|
|
|
require("nvim-dap-virtual-text").setup()
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
2024-03-28 20:45:53 +00:00
|
|
|
},
|
|
|
|
config = function ()
|
|
|
|
local dap = require('dap')
|
2024-10-05 13:25:46 +00:00
|
|
|
-- Godot Config
|
|
|
|
dap.adapters.godot = {
|
|
|
|
type = "server",
|
|
|
|
host = "127.0.0.1",
|
|
|
|
port = 6006
|
|
|
|
}
|
|
|
|
--dap.configurations.gdscript{
|
|
|
|
-- type = "godot",
|
|
|
|
-- request = "launch",
|
|
|
|
-- name = "launch scene",
|
|
|
|
-- project = "${workspaceFolder}"
|
|
|
|
--}
|
|
|
|
-- C/C++ Config
|
2024-07-15 19:58:28 +00:00
|
|
|
dap.configurations.cpp = {
|
|
|
|
{
|
|
|
|
name = "Launch",
|
2024-10-05 13:25:46 +00:00
|
|
|
type= "lldb",
|
2024-07-15 19:58:28 +00:00
|
|
|
request = "launch",
|
|
|
|
program = function ()
|
|
|
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() , 'file')
|
|
|
|
end,
|
|
|
|
stopOnEntry = false,
|
2024-10-05 13:25:46 +00:00
|
|
|
runInTerminal = false,
|
2024-07-15 19:58:28 +00:00
|
|
|
}
|
|
|
|
}
|
2024-09-26 12:46:07 +00:00
|
|
|
dap.adapters.lldb = {
|
2024-10-05 13:25:46 +00:00
|
|
|
type = 'server',
|
|
|
|
port= "${port}",
|
|
|
|
executable = {
|
|
|
|
command = "C:\\Users\\nigel\\AppData\\Local\\nvim-data\\mason\\bin\\codelldb.cmd",
|
|
|
|
args = { "--port", "${port}"}
|
|
|
|
},
|
2024-09-26 12:46:07 +00:00
|
|
|
name = 'lldb'
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Zig configuration
|
|
|
|
dap.configurations.zig = {
|
|
|
|
name = 'launch',
|
|
|
|
type= 'lldb',
|
|
|
|
request = 'launch',
|
|
|
|
program = '${workspaceFolder}/zig-out/bin/tests.exe',
|
|
|
|
cwd = '${workspaceFolder}',
|
|
|
|
}
|
|
|
|
-- Java configuration
|
|
|
|
-- See also ftplugin
|
2024-03-28 20:45:53 +00:00
|
|
|
dap.configurations.java = {
|
|
|
|
{
|
2024-09-26 12:46:07 +00:00
|
|
|
type = 'java',
|
|
|
|
request = 'launch',
|
|
|
|
name = "Launch file",
|
|
|
|
program = "java ${file}",
|
2024-04-06 20:45:06 +00:00
|
|
|
}}
|
2024-10-05 13:25:46 +00:00
|
|
|
-- Golang config
|
2024-04-06 20:45:06 +00:00
|
|
|
dap.configurations.go = {
|
|
|
|
{
|
|
|
|
type = "delve",
|
|
|
|
name = "Debug",
|
|
|
|
request = "launch",
|
|
|
|
program = "${file}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type = "delve",
|
|
|
|
name = "Debug test", -- configuration for debugging test files
|
|
|
|
request = "launch",
|
|
|
|
mode = "test",
|
|
|
|
program = "${file}"
|
2024-03-28 20:45:53 +00:00
|
|
|
},
|
2024-04-06 20:45:06 +00:00
|
|
|
-- works with go.mod packages and sub packages
|
|
|
|
{
|
|
|
|
type = "delve",
|
|
|
|
name = "Debug test (go.mod)",
|
|
|
|
request = "launch",
|
|
|
|
mode = "test",
|
|
|
|
program = "./${relativeFileDirname}"
|
|
|
|
}
|
2024-03-28 20:45:53 +00:00
|
|
|
}
|
2024-04-06 20:45:06 +00:00
|
|
|
dap.adapters.delve = {
|
|
|
|
type = 'server',
|
|
|
|
port = '${port}',
|
|
|
|
executable = {
|
|
|
|
command = 'dlv',
|
|
|
|
args = {'dap', '-l', '127.0.0.1:${port}'},
|
|
|
|
}
|
|
|
|
}
|
2024-10-05 21:20:41 +00:00
|
|
|
local dap = require("dap")
|
|
|
|
local ui = require("dapui")
|
|
|
|
dap.listeners.before.attach.dapui_config = function()
|
|
|
|
ui.open()
|
|
|
|
end
|
|
|
|
dap.listeners.before.launch.dapui_config = function()
|
|
|
|
ui.open()
|
|
|
|
end
|
|
|
|
dap.listeners.before.event_terminated.dapui_config = function()
|
|
|
|
ui.close()
|
|
|
|
end
|
|
|
|
dap.listeners.before.event_exited.dapui_config = function()
|
|
|
|
ui.close()
|
|
|
|
end
|
2024-03-28 20:45:53 +00:00
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|