Closed luismeyer95 closed 6 months ago
Thanks for the PR!
Instead of passing the filetype in the context, let's pass the adapter. The filetype logic is a weird, niche requirement only for the dap strategy so I don't think it should live in the TestRunner
object. The filetype retrieval logic can then live in the dap strategy, and the change to the tests can be reverted :smile:
Good call, done! Thanks for the awesome plugin 👍🏻
Bug
Whenever the debug mapping is used inside the summary window and a breakpoint is hit, nvim-dap hijacks the summary window to focus the breakpoint.
Repro
switchbuf = 'uselast'
in nvim-dap (default)d
on testExpected
The window containing the test buffer should be used to focus the breakpoint.
Fix
nvim-dap
has theswitchbuf
config option to to control how a breakpoint is jumped to, the default isuselast
and it probably makes the most sense as a default for neotest too. It works like this: whendap.run()
is executed, if the current buffer is a normal buffer ordap.run()
is not provided with a differentfiletype
than the current buffer, then the current window is used to focus the breakpoint, otherwise the previous (#
) window is used. Initiallyfiletype
was not provided, so the current window was picked.The change broke some tests due to async related issues. I'm not familiar with async lua so I didn't dive too deep, I saw some sleep hacks being thrown around in tests so I replicated that and it fixed them, lmk if that should be handled differently.