dapui does not open when debugging individual test #67

Closed
opened 2024-01-25 04:14:31 +03:00 by JonPichel · 3 comments
JonPichel commented 2024-01-25 04:14:31 +03:00 (Migrated from github.com)

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

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: ```lua 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
stale[bot] commented 2024-07-26 01:53:23 +03:00 (Migrated from github.com)

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.

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.
leoluz commented 2024-07-28 02:32:30 +03:00 (Migrated from github.com)

@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)?

@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`)?
stale[bot] commented 2025-01-24 06:39:22 +03:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NeonXP/nvim-dap-go#67
No description provided.