You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.6 KiB

2 years ago
local dap = require('dap')
dap.set_log_level('INFO') -- Helps when configuring DAP, see logs with :DapShowLog
2 years ago
dap.adapters = {
bashdb = {
type = 'executable',
command = vim.fn.stdpath("data") ..
'/mason/packages/bash-debug-adapter/bash-debug-adapter',
name = 'bashdb'
},
java = function(callback)
-- FIXME:
-- Here a function needs to trigger the `vscode.java.startDebugSession` LSP command
-- The response to the command must be the `port` used below
callback({ type = 'server', host = '127.0.0.1', port = 5005 })
end,
go = {
type = "server",
port = "${port}",
executable = {
command = vim.fn.stdpath("data") .. '/mason/bin/dlv',
args = { "dap", "-l", "127.0.0.1:${port}" },
}
2 years ago
}
}
dap.configurations = {
go = {
{
type = "go", -- Which adapter to use
name = "Debug", -- Human readable name
request = "launch", -- Whether to "launch" or "attach" to program
program = "${file}", -- The buffer you are focused on when running nvim-dap
},
},
sh = {
{
type = 'bashdb',
request = 'launch',
name = "Launch file",
showDebugOutput = true,
pathBashdb = vim.fn.stdpath("data") ..
'/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb',
pathBashdbLib = vim.fn.stdpath("data") ..
'/mason/packages/bash-debug-adapter/extension/bashdb_dir',
trace = true,
file = "${file}",
program = "${file}",
cwd = '${workspaceFolder}',
pathCat = "cat",
pathBash = "/opt/homebrew/bin/bash",
pathMkfifo = "mkfifo",
pathPkill = "pkill",
args = {},
env = {},
terminalKind = "integrated",
autoReload = { enable = true }
}
},
java = {
{
type = 'java',
request = 'attach',
name = "Debug (Attach) - Remote",
hostName = "127.0.0.1",
port = 5005
}
2 years ago
}
}
require("dapui").setup({
controls = {
-- Requires Neovim nightly (or 0.8 when released)
enabled = true,
-- Display controls in this element
element = "repl",
icons = {
pause = '',
play = '',
step_into = '',
step_over = '.⃕',
step_out = '',
step_back = '',
run_last = '',
terminate = ''
}
}
})