nvim-dap-go icon indicating copy to clipboard operation
nvim-dap-go copied to clipboard

dapui does not open when debugging individual test

Open JonPichel opened this issue 1 year ago • 2 comments

Hi,

When I try to debug an individual test with :lua require('dap-go').debug_test(), the dapui interface does not open. Should I hook dapui.open to some other event?

This is my configuration:

return {
	{
		"mfussenegger/nvim-dap",
    dependencies = {
      "rcarriga/nvim-dap-ui",
      "leoluz/nvim-dap-go",
      "mfussenegger/nvim-dap-python",
    },
		config = function()
      require("dapui").setup()
      require("dap-go").setup()

      require("dap-python").setup("~/.local/share/nvim/mason/packages/debugpy/venv/bin/python")

			local dap = require("dap")
      local dapui = require("dapui")

      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

			vim.keymap.set("n", "<Leader>dt", dap.toggle_breakpoint, {})
			vim.keymap.set("n", "<Leader>dc", dap.continue, {})
			vim.keymap.set("n", "<Leader>dx", dap.terminate, {})
			vim.keymap.set("n", "<Leader>do", dap.step_over, {})
		end,
	},
}

NVIM version v0.9.5

JonPichel avatar Jan 25 '24 01:01 JonPichel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 25 '24 22:07 stale[bot]

@JonPichel debug test will invoke dap.run(config) which should trigger the dap.listeners.before.launch event I think. Unfortunately I don't use dapui much and don't know how to configure it exactly. Maybe try without the dapui_config namespace (just with dap.listeners.before.launch)?

leoluz avatar Jul 27 '24 23:07 leoluz