mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.1k stars 179 forks source link

With preview, a supplied expression is not passed to the refresh #1163

Open torypages opened 4 months ago

torypages commented 4 months ago

Debug adapter definition and debug configuration

No response

Debug adapter version

9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5

Steps to Reproduce

run something like :lua require('dap.ui.widgets').preview("word", {listener={'event_continued'}}) where you supply an expression, in this case, word and a listener.

Expected Result

I expect that my supplied expression would be evaluated when the listeners are triggered.

Actual Result

When the trigger runs, vim.fn.expand('<cexpr>') seems to be evaluated.

torypages commented 4 months ago

In the preview function adding view.__expression = value in between these two lines "fixes" it.

I suppose maybe we need a way to pass additional arguments to the render inside the refresh here