Improve debug console display
Is there any way to improve the printing in the debug console? Here's an example which is rather difficult to read:

There's not much contrast. I think the other problem in this example is that the short-form printing of the nested arrays is pretty difficult to read. These particular arrays print much nicer in the regular REPL. I apologize for the noise if this isn't really possible to improve with the VS Code debugger.
Yes, we can definitely improve this!
Note to myself: the DAP message that is responsible for this is evaluate. It covers both the debug console and things like the watch window. Right now I'm just using repr in all of these cases here. The protocol does allow me to distinguish in what context the evaluation is happening, so we just need to pass that info on in our own protocol, and then call a more useful display method on the Julia side for the REPL case.
It is true that the readability is not that great. What i like is that e.g array output in the debug console can be directly copy-pasted as valid array definition. Maybe i'm just misusing this in my workflow, where I step deep into call-stack and capture variables used for calling a function I'd like to isolate and debug / test / perf-tune the function in isolation. But anyhow, i can just call repr(val) if the defaults change...
Hello there, Sorry to update this aggressively but I also wondered if it is possible to have more information when using the debugger console, especially when errors in the current evaluation occur. For instance, if in the debug console you run the following erroneous syntax, we get this
1 + [1;2]
#error
Any idea on how we can get the regular stack trace ?
julia> 1+[1;2]
ERROR: MethodError: no method matching +(::Int64, ::Array{Int64,1})
For element-wise addition, use broadcasting with dot syntax: scalar .+ array
Closest candidates are:
+(::Any, ::Any, ::Any, ::Any...) at operators.jl:538
+(::T, ::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:86
+(::Union{Int16, Int32, Int64, Int8}, ::BigInt) at gmp.jl:531
...
Stacktrace:
[1] top-level scope at REPL[3]:1
(Note, I often use the debug console to explore additional code, and I often do mistakes :D)
PS: thank's to the pointers in the post before I manage to get part of the info I want by modifying
return EvaluateResponseArguments("#error", missing, missing, 0, missing, missing, missing) by return EvaluateResponseArguments("$err", missing, missing, 0, missing, missing, missing) in the file debugger_request.jl. Not sure about the potential side effects though.
@davidanthoff I hit this today and was curious whether #1838 and #1796 might be related as there were some upstream changes regarding DAP in https://github.com/microsoft/vscode/issues/113921.
No, those are unrelated (only relevant for errors happening while debugging, not in the debug console). We can just fix this issue without any upstream changes, afaict.
@pfitzseb thanks for checking back and clarifying. I was only thinking that the mentioned upstream changes may affect or help this issue in any way.
Is there any update on this? 🤔 It would be great to see some improvements in the debug console. Right now, the command output isn’t highlighted, and I can’t expand the output hash in a readable format. Instead, I only get expandable views of the underlying data structures and metadata, which aren’t really needed as frequently.