Closed balazser closed 2 years ago
There is a difference on how the value is determined between the virtual text and the evaluation in the REPL. The REPL does an "eval" request of an arbitrary expressions while this plugin just uses the value of the variable
environment (with preference for locals
, it's a list of key/value pairs provided by the debug adapter) provided by the debug adapter. I'll check whether VSCode or the dap-ui plugin behave differently. Most likely a value that doesn't get updated is due to the debug adapter. But maybe there is also a bug in this plugin. Will check later.
I found the issue
It seems that python-debug-adapter does set the "local" attribute to the local scope and then my plugin just uses any of the scopes (globals in this example). I can re-add the heuristic that we had here earlier that would match the string value "locals" as preferred scope.
Actual Shows a wrong value for the
arr: list[tuple[int,int]]
variable. Expected Show the right value[(1, 2), (0, 3), (2, 4)]
You can see on the attached screenshot
[nvim-dap-virtual-text](https://github.com/theHamsta/nvim-dap-virtual-text)
shows[3, 2, 4]
while at the bottom dap repr shows[(1, 2), (0, 3), (2, 4)]
Code that I used.