You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately I'm not able to get this to work on my laptop (Macbook M1, Sonoma 14.5) as it's resulting in ECONNREFUSED. I'm afraid I don't have much experience with the DAP protocol, so my trouble-shooting abilities are a little limited, but I have been able to get Delve (Go's DAP) running as expected. Other related issues I found in nvim-dap were related to localhost, but that doesn't seem to be the issue here as the default setup already uses 127.0.0.1 rather than localhost (mfussenegger/nvim-dap#1031).
This is my current dap setup (based on kickstart.nvim), but I've also tried the configs listed in the README (both simple and advanced versions).
return {
'mfussenegger/nvim-dap',
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
'nvim-neotest/nvim-nio',
'theHamsta/nvim-dap-virtual-text',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
'leoluz/nvim-dap-go',
'kdheepak/nvim-dap-julia',
},
event = 'BufEnter',
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
dapui.setup()
require('mason').setup {}
nmap('<leader>vm', ':Mason<cr>', 'Mason')
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
},
}
-- Basic debugging keymaps, feel free to change to your liking!
nmap('<leader>dB', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, 'Breakpoint Condition')
nmap('<leader>db', dap.toggle_breakpoint, 'Toggle Breakpoint')
nmap('<leader>dc', dap.continue, 'Continue')
nmap('<leader>da', function()
local get_args = vim.fn.input 'Args: '
dap.continue { before = get_args }
end, 'Run with Args')
nmap('<leader>dC', dap.run_to_cursor, 'Run to Cursor')
nmap('<leader>dg', dap.goto_, 'Go to line (no execute)')
nmap('<leader>di', dap.step_into, 'Step Into')
nmap('<leader>dj', dap.down, 'down')
nmap('<leader>dk', dap.up, 'Up')
nmap('<leader>dl', dap.run_last, 'Run Last')
nmap('<leader>do', dap.step_out, 'Step Out')
nmap('<leader>dO', dap.step_over, 'Step Over')
nmap('<leader>dp', dap.pause, 'Pause')
nmap('<leader>dr', dap.repl.toggle, 'Toggle REPL')
nmap('<leader>ds', dap.session, 'Session')
nmap('<leader>dt', dap.terminate, 'Terminate')
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
nmap('<leader>dL', dapui.toggle, 'Debug: See last session result.')
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install language specific config
require('dap-go').setup()
require('nvim-dap-julia').setup()
end,
}
Thanks for putting this together - looking forward to being able to use the DAP in nvim.
The text was updated successfully, but these errors were encountered:
That worked - thanks @SoichiroYamane! I'll leave this open for the moment, as it requires a little more work than the usual setup, though feel free to close (I can add this information to the README if no changes are to be made at the moment).
Unfortunately I'm not able to get this to work on my laptop (Macbook M1, Sonoma 14.5) as it's resulting in ECONNREFUSED. I'm afraid I don't have much experience with the DAP protocol, so my trouble-shooting abilities are a little limited, but I have been able to get Delve (Go's DAP) running as expected. Other related issues I found in nvim-dap were related to localhost, but that doesn't seem to be the issue here as the default setup already uses
127.0.0.1
rather thanlocalhost
(mfussenegger/nvim-dap#1031).This is my current dap setup (based on kickstart.nvim), but I've also tried the configs listed in the README (both simple and advanced versions).
Thanks for putting this together - looking forward to being able to use the DAP in nvim.
The text was updated successfully, but these errors were encountered: