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

Scopes widget (and probably others) doesn’t refresh on session change. No session changed event

Open miroshQa opened this issue 1 year ago • 0 comments

Debug adapter definition and debug configuration

No response

Debug adapter version

main branch

Steps to Reproduce

  1. Setup some autcommands to open scopes and sessions widget
local widgets = require("dap.ui.widgets")  
vim.api.nvim_create_user_command("OpenScopes", function()  
  widgets.sidebar(widgets.scopes).open()  
end, {})  

vim.api.nvim_create_user_command("OpenSesssions", function()  
  widgets.cursor_float(widgets.sessions).open()  
end, {})
  1. Open project to debug, set breakpoint, start new session

  2. Open scopes widget and make a few steps over so widget changes its initial state

  3. Start new session (:DapNew)

  4. This time, scopes widget updates

  5. Now change session back using sessions widget (:OpenSessions)

  6. This time, scopes widget doesn’t update, and we need to close it and reopen to see the actual scopes for this session

Expected Result

Scopes widget (and others) updates when we set a new active session. When we change the active session, "sessionEvent" fires. (This could be useful in other cases too.)

Actual Result

https://github.com/user-attachments/assets/cb0246bc-6635-435d-a35b-63bfe52cdc7a

The video is a bit messy but I hope you got the gist

miroshQa avatar Mar 31 '25 10:03 miroshQa