87 lines
2.6 KiB
Lua
87 lines
2.6 KiB
Lua
return {
|
|
{ 'mfussenegger/nvim-dap',
|
|
dependencies = {
|
|
'rcarriga/nvim-dap-ui',
|
|
},
|
|
keys = {
|
|
{ '<F2>', function() require('dap').step_over() end },
|
|
{ '<F3>', function() require('dap').step_into() end },
|
|
{ '<F4>', function() require('dap').step_out() end },
|
|
{ '<F5>', function() require('dap').continue({}) end },
|
|
{ '<F10>', function() require('dap').toggle_breakpoint() end },
|
|
{ '<leader>DD', function() require('dapui').toggle() end },
|
|
{ '<leader>DE', function()
|
|
vim.ui.input({ prompt = 'DAP Evalulate expression: ' },
|
|
function(input)
|
|
require('dapui').eval(input)
|
|
end)
|
|
end, },
|
|
},
|
|
opts = {
|
|
php = { -- {{{
|
|
adapter = {
|
|
type = 'executable',
|
|
command = 'node',
|
|
args = { vim.env.HOME .. '/.local/share/nvim/lazy/vscode-php-debug/out/phpDebug.js' },
|
|
},
|
|
confs = {
|
|
{
|
|
type = 'php',
|
|
request = 'launch',
|
|
name = 'Listen for Xdebug',
|
|
port = 9000,
|
|
},
|
|
},
|
|
}, -- }}}
|
|
},
|
|
config = function(_plug, opts)
|
|
-- signs - move to colorsheme? {{{
|
|
vim.fn.sign_define('DapBreakpoint', {
|
|
text = '⦿',
|
|
texthl = 'DiagnosticSignError',
|
|
linehl = '',
|
|
numhl = ''
|
|
})
|
|
vim.fn.sign_define('DapBreakpointCondition', {
|
|
text = '✪',
|
|
texthl = 'DiagnosticSignError',
|
|
linehl = '',
|
|
numhl = ''
|
|
})
|
|
vim.fn.sign_define('DapLogPoint', { text = '', texthl = '', linehl = '', numhl = '' })
|
|
vim.fn.sign_define('DapStopped', { text = '', texthl = 'DiagnosticSignOk', linehl = '', numhl = '' })
|
|
vim.fn.sign_define('DapBreakpointRejected', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
|
--- }}}
|
|
|
|
local dap = require('dap')
|
|
|
|
for lang, opt in pairs(opts) do
|
|
dap.configurations[lang] = opt.confs
|
|
dap.adapters[lang] = opt.adapter
|
|
end
|
|
|
|
local dapui = require('dapui')
|
|
dapui.setup()
|
|
|
|
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,
|
|
},
|
|
{ 'xdebug/vscode-php-debug',
|
|
build = { 'npm install && npm run build' },
|
|
config = false,
|
|
module = false,
|
|
lazy = true,
|
|
},
|
|
{ 'leoluz/nvim-dap-go',
|
|
ft = 'go',
|
|
config = true,
|
|
},
|
|
}
|