Closed carschandler closed 3 weeks ago
Although confusing this is actually expected.
debugpy returns 10
as result of the expression, but also prints 10 as side-effect to stdout/reports it as output event.
If you use the integrated terminal you'll only see it once in the REPL, and once in the terminal.
Not much to do about that on the client side because different debug adapters behave different in this regard, and the client doesn't know that the output event is related in that way to the expression result.
You could override on_output
and customized it if you wanted to (see dap.defaults
)
(Or just evaluate expressions directly without wrapping them in print
)
I figured this wasn't actually a bug, but had been irking me since I started using DAP a few months back and I couldn't find anything on it in other issues/discussions so I figured at the least it would be good to have it out there for others in the future. Thank you for the tip on the integrated terminal!
Debug adapter definition and debug configuration
Installed via Lazy. Minimal plugin config:
Debug adapter version
debugpy v1.8.1
Steps to Reproduce
In any project, start DAP, open the REPL, and
print("anything")
.Expected Result
The object is printed once
Actual Result
The object is printed twice