When the focus is on the summary panel, this returns the current working directory.
Since we already know the exact path to the testfile by neotests positions, there's no need to rely on the information about the current window returned by vim.fn.expand function present in the dap client.
Why is this PR needed
Currently when trying to debug tests via the Neotest Summary panel, the generated
dap_configuration
is not correct.The variable
fileDirname
is expanded in nvim-dap asvim.fn.expand("%:p:h")
See https://github.com/mfussenegger/nvim-dap/blob/7ff6936010b7222fea2caea0f67ed77f1b7c60dd/lua/dap.lua#L338-L340When the focus is on the summary panel, this returns the current working directory.
Since we already know the exact path to the testfile by neotests positions, there's no need to rely on the information about the current window returned by
vim.fn.expand
function present in the dap client.